Game Development Reference
In-Depth Information
{
started = false;
UnloadPluginDirectory();
beginShutdown = true;
while (active)
{
Thread.Sleep(100);
}
}
catch
{
//Quietly ignore unload exceptions
}
}
The following method is the logic for the reload plugins thread. This method con-
tinuously loops while active, and the plugins are reloaded when the change time is
set by the FileSystemWatcher object.
protected void ReloadPluginsThread()
{
if (!started)
{
throw new InvalidOperationException(“PluginManager not started.”);
}
DateTime invalidTime = new DateTime(0);
while (!beginShutdown)
{
if (changeTime != invalidTime && DateTime.Now > changeTime)
{
ReloadPlugins();
}
Thread.Sleep(5000);
}
active = false;
}
Search Nedrilad ::




Custom Search