예제 #1
0
        private bool RemovePluginViewItem(PluginViewItem pvi, bool noRaiseEvent)
        {
            bool flag;

            SuspendLayout();
            try {
                if (!noRaiseEvent)
                {
                    PluginOptionEventArgs e = new PluginOptionEventArgs(pvi);
                    if (PluginRemoved != null)
                    {
                        PluginRemoved(this, e);
                        if (e.Cancel)
                        {
                            return(false);
                        }
                    }
                }
                int index = Controls.IndexOf(pvi);
                if (iSelectedIndex == index)
                {
                    iSelectedIndex = -1;
                }
                if (index > -1)
                {
                    Controls.RemoveAt(index);
                    RowStyles.RemoveAt(index);
                    RowCount--;
                    for (int i = 0; i < Controls.Count; i++)
                    {
                        SetRow(Controls[i], i);
                    }
                    pvi.Dispose();
                    return(true);
                }
                flag = false;
            }
            finally {
                ResumeLayout();
            }
            return(flag);
        }
예제 #2
0
 private void pluginView_PluginRemoved(object sender, PluginOptionEventArgs e) {
     PluginAssembly pluingAssembly = e.PluginViewItem.PluingAssembly;
     if(pluingAssembly.PluginInformations.Count > 1) {
         string str = pluingAssembly.PluginInformations.Select(info => info.Name).StringJoin(", ");
         if(DialogResult.OK != MessageBox.Show(string.Format(RES_REMOVEPLGIN, str), string.Empty, MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
             e.Cancel = true;
             return;
         }
         pluginView.RemovePluginsRange(pluingAssembly.PluginInformations.ToArray());
     }
     DeletePluginAssembly(pluingAssembly);
 }
예제 #3
0
 private void pluginView_PluginAboutRequired(object sender, PluginOptionEventArgs e) {
     PluginInformation pluginInfo = e.PluginViewItem.PluginInfo;
     string strMessage = pluginInfo.Name + Environment.NewLine + pluginInfo.Version + Environment.NewLine + pluginInfo.Author + Environment.NewLine + Environment.NewLine + "\"" + pluginInfo.Path + "\"";
     MessageForm.Show(Handle, strMessage, string.Format(PluginView.MNU_PLUGINABOUT, pluginInfo.Name), MessageBoxIcon.Asterisk, 0xea60);
 }
예제 #4
0
 private void pluginView_PluginOptionRequired(object sender, PluginOptionEventArgs e) {
     Plugin plugin;
     if((pluginManager.TryGetPlugin(e.PluginViewItem.PluginInfo.PluginID, out plugin) && (plugin != null)) && (plugin.Instance != null)) {
         try {
             plugin.Instance.OnOption();
         }
         catch(Exception exception) {
             PluginManager.HandlePluginException(exception, Handle, plugin.PluginInformation.Name, "Open plugin option.");
             QTUtility2.MakeErrorLog(exception, "Error at Plugin: " + e.PluginViewItem.PluginInfo.Name);
         }
     }
 }
예제 #5
0
 private void pluginView_PluginRemoved(object sender, PluginOptionEventArgs e) {
     PluginAssembly pluingAssembly = e.PluginViewItem.PluingAssembly;
     if(pluingAssembly.PluginInformations.Count > 1) {
         string str = string.Empty;
         foreach(PluginInformation information in pluingAssembly.PluginInformations) {
             str = str + " " + information.Name + ",";
         }
         str = str.TrimEnd(new char[] { ',' });
         if(DialogResult.OK != MessageBox.Show(string.Format(RES_REMOVEPLGIN, str), string.Empty, MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
             e.Cancel = true;
             return;
         }
         this.pluginView.RemovePluginsRange(pluingAssembly.PluginInformations.ToArray());
     }
     this.DeletePluginAssembly(pluingAssembly);
 }