Game Development Reference
In-Depth Information
{
if (autoReload != value)
{
autoReload = value;
if (!autoReload)
{
fileSystemWatcher.EnableRaisingEvents = false;
ReleasePluginRuntime();
pluginReloadThread = null;
fileSystemWatcher = null;
}
else
{
CreateFileSystemWatcherAndThread();
}
}
}
}
public PluginCatalogue(string pluginDirectory)
{
this.pluginDirectory = pluginDirectory;
}
public void FireUnloadEvent()
{
if (UnloadedPlugins != null)
UnloadedPlugins(this, EventArgs.Empty);
}
The following method creates the FileSystemWatcher object, points it at the plugin
directory, and binds the event handlers to the appropriate method. The reload
plugin thread is also created here.
private void CreateFileSystemWatcherAndThread()
{
DirectoryInfo directory = new DirectoryInfo(pluginDirectory);
if (!directory.Exists)
directory.Create();
Search Nedrilad ::




Custom Search