/// <summary> /// Removes a plugin from this manager /// </summary> /// <param name="plugin"></param> /// <returns></returns> public bool RemovePlugin(Plugin plugin) { if (!loadedPlugins.ContainsKey(plugin.Name)) { return(false); } loadedPlugins.Remove(plugin.Name); foreach (var list in hookSubscriptions.Values) { if (list.Contains(plugin)) { list.Remove(plugin); } } plugin.HandleRemovedFromManager(this); OnPluginRemoved?.Invoke(plugin); return(true); }
/// <summary> /// Fires the OnPluginRemoved event /// </summary> /// <param name="name"></param> protected void FirePluginRemoved(string name) => OnPluginRemoved?.Invoke(name);