Exemplo n.º 1
0
        public void RemovePlugin(PluginBase plugin)
        {
            if (!_plugins.ContainsKey(plugin.Name))
                throw new InvalidOperationException("The plugin is not loaded.");

            plugin.OnUnload();
            _plugins.Remove(plugin.Name);
        }
Exemplo n.º 2
0
        public void AddPlugin(PluginBase plugin)
        {
            if (_plugins.ContainsKey(plugin.Name))
                throw new InvalidOperationException("The plugin has already been loaded.");

            plugin.AppInstance = this;
            plugin.OnLoad();
            _plugins.Add(plugin.Name, plugin);
        }