Exemplo n.º 1
0
 private void RemoveUserPlugin()
 {
     if (this.ltvPlugins_OQ.SelectedItems.Count == 1)
     {
         PluginOQViewItem pluginOqViewItem = (PluginOQViewItem)this.ltvPlugins_OQ.SelectedItems[0];
         PluginInfo       plugin           = pluginOqViewItem.Plugin;
         if (MessageBox.Show((IWin32Window)this, string.Format("Are you sure to remove {0}, {1} ?", (object)plugin.TypeName, (object)plugin.AssemblyName), "Remove", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
         {
             return;
         }
         pluginOqViewItem.Remove();
         this.OptionsChanged = true;
     }
     else
     {
         int num = (int)MessageBox.Show((IWin32Window)this, "No provider selected.", "Remove", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemplo n.º 2
0
        private void ltvPlugins_OQ_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (this.ignoreCheckEvent)
            {
                return;
            }
            PluginOQViewItem pluginOqViewItem = (PluginOQViewItem)this.ltvPlugins_OQ.Items[e.Index];
            PluginInfo       plugin           = pluginOqViewItem.Plugin;

            if (e.NewValue == CheckState.Unchecked && this.IsPluginInUse(plugin))
            {
                int num = (int)MessageBox.Show((IWin32Window)this, "Cannot disable provider because it is used in one of configuration modes.", "Cannot Disable Provider", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                e.NewValue = CheckState.Checked;
            }
            else
            {
                if (e.NewValue == CheckState.Checked && !plugin.Loaded)
                {
                    Global.PluginManager.LoadPlugin(plugin);
                    pluginOqViewItem.UpdateIcon();
                }
                this.OptionsChanged = true;
            }
        }