예제 #1
0
        /// <summary>
        /// Add plugin settings to the collection.
        /// </summary>
        public void Add(PluginSettings settings)
        {
            if(Contains(settings.Identifier))
                throw new InvalidOperationException(string.Format("Plugin settings for plugin '{0}' already exists.", settings.Identifier));

            _list.Add(settings);
        }
예제 #2
0
        /// <summary>
        /// Changes the plugin to use for the destination.
        /// </summary>
        /// <param name="descriptor">A descriptor for the plugin.</param>
        public void ChangePlugin(PluginDescriptor descriptor)
        {
            if (descriptor == null) throw new ArgumentNullException();

            if(descriptor.PluginTypeFullName == _pluginsettings.Type)
                return;

            // Unload old plugin and create empty settings for the new one
            PluginManager.UnloadPluginForDestination(this);
            _pluginsettings = new PluginSettings(descriptor);
        }