public static void UnregisterSAE()
 {
     foreach (string fileType in fileTypes)
     {
         ShellExtUtils.Unregister(fileType, menuText);
     }
 }
Ejemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Config.CheckUpdateEnabled = chkCheckUpdateEnabled.Checked;
            Config.CheckUpdatePeriod  = (cboCheckUpdatePeriod.SelectedIndex + 1) * 7;

            Config.ClassEditorAutoSaveBookmarkEnabled        = chkAutoSaveBookmarkEnabled.Checked;
            Config.ClassEditorAutoOpenDroppedAssemblyEnabled = chkAutoOpenDroppedAssembly.Checked;
            Config.ClassEditorRichTextBoxFont = lblRtbFont.Font;
            Config.ClassEditorBamlTranslator  = cboBamlTranslator.SelectedIndex;

            int recentPluginList = (int)nudRecentPluginList.Value;

            if (recentPluginList != Config.RecentPluginList)
            {
                _mainForm.PluginHandler.ClearPlugins();
                Config.RecentPluginList = recentPluginList;
                _mainForm.PluginHandler.LoadPlugins();
            }

            if (chkIntegrateWithExplorer.Enabled)
            {
                if (chkIntegrateWithExplorer.Checked)
                {
                    ShellExtUtils.RegisterSAE();
                }
                else
                {
                    ShellExtUtils.UnregisterSAE();
                }
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Ejemplo n.º 3
0
        public void InitForm(frmMain mainForm)
        {
            _mainForm = mainForm;

            int period = (int)(Config.CheckUpdatePeriod / 7) - 1;

            if (period < 0 || period > 3)
            {
                period = 1;
            }

            cboCheckUpdatePeriod.SelectedIndex = period;
            chkCheckUpdateEnabled.Checked      = Config.CheckUpdateEnabled;

            nudRecentPluginList.Value = Config.RecentPluginList;

            chkAutoSaveBookmarkEnabled.Checked = Config.ClassEditorAutoSaveBookmarkEnabled;
            chkAutoOpenDroppedAssembly.Checked = Config.ClassEditorAutoOpenDroppedAssemblyEnabled;
            lblRtbFont.Font = Config.ClassEditorRichTextBoxFont;

            if (ShellExtUtils.IsSAERegistered())
            {
                chkIntegrateWithExplorer.Checked = true;
            }
            else
            {
                chkIntegrateWithExplorer.Checked = false;
            }

            cboBamlTranslator.SelectedIndex = Config.ClassEditorBamlTranslator;

            chkIntegrateWithExplorer.Enabled = ShellExtUtils.IsAdministrator();
        }
        public static void RegisterSAE()
        {
            string menuCommand = string.Format("\"{0}\" \"%L\"",
                                               System.Windows.Forms.Application.ExecutablePath);

            foreach (string fileType in fileTypes)
            {
                ShellExtUtils.Register(fileType, menuText, menuText, menuCommand);
            }
        }