Beispiel #1
0
        public void Remove(string key)
        {
            Logger.LogDebug(this, "[CLASS].Remove('{0}')", key);

            try
            {
                XmlSettingsItem pluginSection = this.Settings.GetItem(PluginManager.SETTINGS_KEY_PLUGINS);
                if (pluginSection != null)
                {
                    pluginSection.Remove(key);
                    this.Settings.SaveSettings();
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(this, ex);

                throw;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Remove the specified plug-in package from the settings and also unload the package from the current application instance.
        /// </summary>
        /// <param name="packageId">Plug-in package unique identifier.</param>
        public void Remove(string packageId)
        {
            Logger.LogDebug(this, "[CLASS].Remove('{0}')", packageId);

            try
            {
                // Remove from the settings
                XmlSettingsItem pluginSection = this.GetPluginsSection();
                pluginSection.Remove(packageId);
                OTCContext.Settings.SaveSettings();

                // Remove from current instance
                this.InstalledPackages.Remove(this.GetPluguinPackage(packageId));
            }
            catch (Exception ex)
            {
                Logger.LogError(this, ex);
                throw ex;
            }
        }