예제 #1
0
 public bool IsInstalled(TextEditors editor)
 {
     return(editor switch
     {
         TextEditors.Sublime2 => IsSublimeInstalled(),
         TextEditors.NotePad => IsNotepadInstalled(),
         _ => false
     });
		public bool IsBizLuaRegistered(TextEditors editor)
		{
			switch (editor)
			{
				case TextEditors.Sublime2:
					return IsBizLuaSublimeInstalled();
				case TextEditors.NotePad:
					return IsBizLuaNotepadInstalled();
			}

			return false;
		}
		public void InstallBizLua(TextEditors editor)
		{
			switch(editor)
			{
				case TextEditors.Sublime2:
					InstallBizLuaToSublime2();
					break;
				case TextEditors.NotePad:
					InstallBizLuaToNotepad();
					break;
			}
		}
		public bool IsInstalled(TextEditors editor)
		{
			switch(editor)
			{
				case TextEditors.Sublime2:
					return IsSublimeInstalled();
				case TextEditors.NotePad:
					return IsNotepadInstalled();
			}

			return false;
		}
예제 #5
0
        public void InstallBizLua(TextEditors editor)
        {
            switch (editor)
            {
            case TextEditors.Sublime2:
                InstallBizLuaToSublime2();
                break;

            case TextEditors.NotePad:
                InstallBizLuaToNotepad();
                break;
            }
        }
예제 #6
0
        public bool IsBizLuaRegistered(TextEditors editor)
        {
            switch (editor)
            {
            case TextEditors.Sublime2:
                return(IsBizLuaSublimeInstalled());

            case TextEditors.NotePad:
                return(IsBizLuaNotepadInstalled());
            }

            return(false);
        }
예제 #7
0
        public bool IsInstalled(TextEditors editor)
        {
            switch (editor)
            {
            case TextEditors.Sublime2:
                return(IsSublimeInstalled());

            case TextEditors.NotePad:
                return(IsNotepadInstalled());
            }

            return(false);
        }
        public void InstallBizLua(TextEditors editor, LuaDocumentation docs)
        {
            switch (editor)
            {
            case TextEditors.Sublime2:
                InstallBizLuaToSublime2(docs);
                break;

            case TextEditors.NotePad:
                InstallBizLuaToNotepad(docs);
                break;
            }
        }
예제 #9
0
        /// <summary>
        /// Saves the defined text editors.
        /// </summary>

        private void SaveEditors()
        {
            if (TextEditorsList.Items.Count == 0)
            {
                TextEditors.Save(null);
                return;
            }

            TextEditor[] editors = new TextEditor[TextEditorsList.Items.Count];
            int          index   = 0;

            foreach (ListViewItem item in TextEditorsList.Items)
            {
                editors[index] = item.Tag as TextEditor;
                index         += 1;
            }

            TextEditors.Save(editors);
        }
예제 #10
0
        /// <summary>
        /// Handles setting the user specified options into the correct controls for display.
        /// </summary>
        /// <param name="sender">System parameter</param>
        /// <param name="e">System parameter</param>

        private void frmOptions_Load(object sender, System.EventArgs e)
        {
            cboPathMRUCount.SelectedIndex = GeneralSettings.MaximumMRUPaths - 1;
            chkRightClickOption.Checked   = Shortcuts.IsSearchOption();
            if (Registry.IsInstaller())
            {
                chkDesktopShortcut.Visible   = false;
                chkStartMenuShortcut.Visible = false;
            }
            else
            {
                chkDesktopShortcut.Checked   = Shortcuts.IsDesktopShortcut();
                chkStartMenuShortcut.Checked = Shortcuts.IsStartMenuShortcut();
            }
            chkShowExclusionErrorMessage.Checked = GeneralSettings.ShowExclusionErrorMessage;
            chkSaveSearchOptions.Checked         = GeneralSettings.SaveSearchOptionsOnExit;
            chkDetectFileEncoding.Checked        = GeneralSettings.DetectFileEncoding;
            chkUseEncodingCache.Checked          = GeneralSettings.UseEncodingCache;
            chkSaveMessagesPosition.Checked      = GeneralSettings.LogDisplaySavePosition;
            chkSaveExclusionsPosition.Checked    = GeneralSettings.ExclusionsDisplaySavePosition;
            chkLabelColor.Checked = GeneralSettings.UsebSearchAccentColor;

            // ColorButton init
            ForeColorButton.SelectedColor            = Convertors.ConvertStringToColor(GeneralSettings.HighlightForeColor);
            BackColorButton.SelectedColor            = Convertors.ConvertStringToColor(GeneralSettings.HighlightBackColor);
            btnResultsWindowForeColor.SelectedColor  = Convertors.ConvertStringToColor(GeneralSettings.ResultsForeColor);
            btnResultsWindowBackColor.SelectedColor  = Convertors.ConvertStringToColor(GeneralSettings.ResultsBackColor);
            btnResultsContextForeColor.SelectedColor = Convertors.ConvertStringToColor(GeneralSettings.ResultsContextForeColor);

            // results font
            rtxtResultsPreview.Font = Convertors.ConvertStringToFont(GeneralSettings.ResultsFont);
            DisplayFont(rtxtResultsPreview.Font, lblCurrentFont);

            // file list font
            DisplayFont(__FileFont, lblFileCurrentFont);

            tbcOptions.SelectedTab = tabGeneral;

            LoadEditors(TextEditors.GetAll());
            LoadPlugins();
            LoadFileEncodings();

            //Language.GenerateXml(this, Application.StartupPath + "\\" + this.Name + ".xml");
            Language.ProcessForm(this);
            Language.LoadComboBox(cboLanguage);

            // set the user selected language
            if (cboLanguage.Items.Count > 0)
            {
                foreach (object oItem in cboLanguage.Items)
                {
                    LanguageItem item = (LanguageItem)oItem;
                    if (item.Culture.Equals(GeneralSettings.Language, StringComparison.OrdinalIgnoreCase))
                    {
                        cboLanguage.SelectedItem = item;
                        break;
                    }
                }
            }

            // setup the performance drop down list
            List <EncodingPerformance> performanceValues = new List <EncodingPerformance>();
            Array values = Enum.GetValues(typeof(EncodingOptions.Performance));

            foreach (EncodingOptions.Performance val in values)
            {
                performanceValues.Add(new EncodingPerformance()
                {
                    Name = Language.GetGenericText(string.Format("FileEncoding.Performance.{0}", Enum.GetName(typeof(EncodingOptions.Performance), val))), Value = (int)val
                });
            }
            cboPerformance.DisplayMember = "Name";
            cboPerformance.ValueMember   = "Value";
            cboPerformance.DataSource    = performanceValues;
            cboPerformance.SelectedValue = GeneralSettings.EncodingPerformance;
            chkDetectFileEncoding_CheckedChanged(null, null);

            // set column text
            TextEditorsList.Columns[0].Text = Language.GetGenericText("TextEditorsColumnFileType");
            TextEditorsList.Columns[1].Text = Language.GetGenericText("TextEditorsColumnLocation");
            TextEditorsList.Columns[2].Text = Language.GetGenericText("TextEditorsColumnCmdLine");
            TextEditorsList.Columns[3].Text = Language.GetGenericText("TextEditorsColumnTabSize");
            PluginsList.Columns[0].Text     = Language.GetGenericText("PluginsColumnEnabled");
            PluginsList.Columns[1].Text     = Language.GetGenericText("PluginsColumnName");
            PluginsList.Columns[2].Text     = Language.GetGenericText("PluginsColumnExtensions");
            lstFiles.Columns[0].Text        = Language.GetGenericText("FileEncoding.Enabled", "Enabled");
            lstFiles.Columns[1].Text        = Language.GetGenericText("FileEncoding.FilePath", "File Path");
            lstFiles.Columns[2].Text        = Language.GetGenericText("FileEncoding.Encoding", "Encoding");

            // set column widths
            TextEditorsList.Columns[0].Width = Constants.OPTIONS_TEXT_EDITOR_COLUMN_0_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            TextEditorsList.Columns[1].Width = Constants.OPTIONS_TEXT_EDITOR_COLUMN_1_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            TextEditorsList.Columns[2].Width = Constants.OPTIONS_TEXT_EDITOR_COLUMN_2_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            TextEditorsList.Columns[3].Width = Constants.OPTIONS_TEXT_EDITOR_COLUMN_3_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            PluginsList.Columns[0].Width     = Constants.OPTIONS_PLUGINS_COLUMN_0_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            PluginsList.Columns[1].Width     = Constants.OPTIONS_PLUGINS_COLUMN_1_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            PluginsList.Columns[2].Width     = Constants.OPTIONS_PLUGINS_COLUMN_2_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            lstFiles.Columns[0].Width        = Constants.OPTIONS_FILES_COLUMN_0_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            lstFiles.Columns[1].Width        = Constants.OPTIONS_FILES_COLUMN_1_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;
            lstFiles.Columns[2].Width        = Constants.OPTIONS_FILES_COLUMN_2_WIDTH * GeneralSettings.WindowsDPIPerCentSetting / 100;

            chkUseDataBase.Checked       = GeneralSettings.UseDataBase;
            chkIntegritySecurity.Checked = GeneralSettings.UseIntegritySecurity;
            cboDataBase.Text             = GeneralSettings.Database;
            cboServer.Text   = GeneralSettings.Server;
            txtLogin.Text    = GeneralSettings.Login;
            txtPassword.Text = GeneralSettings.Password;

            if (chkUseDataBase.Checked)
            {
                chkIntegritySecurity.Enabled = true;
                cboDataBase.Enabled          = true;
                cboServer.Enabled            = true;
                txtLogin.Enabled             = true;
                txtPassword.Enabled          = true;
            }
            else
            {
                chkIntegritySecurity.Enabled = false;
                cboDataBase.Enabled          = false;
                cboServer.Enabled            = false;
                txtLogin.Enabled             = false;
                txtPassword.Enabled          = false;
            }
        }