} //Will be used by poehud main menu to display why plugin is not loaded/reloaded public ExternalPluginHolder(PluginExtensionPlugin api, string dllPath, string fullTypeName) : base(Path.GetFileNameWithoutExtension(dllPath)) { API = api; DllPath = dllPath; FullTypeName = fullTypeName; PluginDirectory = Path.GetDirectoryName(dllPath); ReloadPlugin(); DllChangeWatcher = new FileSystemWatcher(); DllChangeWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime;// | NotifyFilters.Size | NotifyFilters.FileName; DllChangeWatcher.Path = PluginDirectory; DllChangeWatcher.Changed += DllChanged; DllChangeWatcher.EnableRaisingEvents = true; }
public ExternalPluginHolder(PluginExtensionPlugin api, string dllPath, string fullTypeName) : base(Path.GetFileNameWithoutExtension(dllPath)) { API = api; _dllPath = dllPath; _fullTypeName = fullTypeName; PluginDirectory = Path.GetDirectoryName(dllPath); ReloadPlugin(false); var dllChangeWatcher = new FileSystemWatcher { NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime, Path = PluginDirectory, EnableRaisingEvents = true }; dllChangeWatcher.Changed += DllChanged; api.eClose += () => dllChangeWatcher.Dispose(); }