Exemple #1
0
 public void Save()
 {
     this.UpdateModel(this.cboFileExtension.Text);
     TextHighlighterConfigApi.GlobalColorDefinition.Save();
     TextHighlighterConfigApi.PurgeGlobalColorDefinition();
     TextHighlighterExtension.ConfigurationEngine.Refresh();
 }
Exemple #2
0
        private void txtDownRule_Click(object sender, EventArgs e)
        {
            var itm = this.lvColor.SelectedItems[0];
            var b   = this.GetSelectedFileColorDefinitionSet();

            b.MoveDown(itm.Text);
            b.PopulateListView(this.lvColor);
            TextHighlighterConfigApi.SetFileColorDefinitionSet(cboFileExtension.Text, b);
        }
Exemple #3
0
        private TextHighlighterColorDefinition.FileColorDefinitionSet GetSelectedFileColorDefinitionSet()
        {
            if (cboFileExtension.SelectedIndex == -1)
            {
                return(null);
            }

            return(TextHighlighterConfigApi.GetFileColorDefinitionSet(cboFileExtension.Text));
        }
Exemple #4
0
        private void cboBackGroundColorTheme_SelectionChangeCommitted(object sender, EventArgs e)
        {
            this.lvColor.Visible      = false;
            this.cboColorList.Visible = false;
            cboFileExtension_PreviousSelectedValue = null;

            // Force to reload the new Color Definition
            TextHighlighterConfigApi.PurgeGlobalColorDefinition();
            TextHighlighterConfigApi.SetBackGroundColorDefinition(cboBackGroundColorTheme.Text);
            this.ReloadUI();
        }
Exemple #5
0
        private void txtNewRule_Click(object sender, EventArgs e)
        {
            string exp = Microsoft.VisualBasic.Interaction.InputBox("", "New Regular Expression", "");

            if (!string.IsNullOrEmpty(exp))
            {
                var b = this.GetSelectedFileColorDefinitionSet();
                b.AddColorDefinition(exp);
                b.PopulateListView(this.lvColor);
                TextHighlighterConfigApi.SetFileColorDefinitionSet(cboFileExtension.Text, b);
                var ba = this.GetSelectedFileColorDefinitionSet();
            }
        }
Exemple #6
0
        private void LoadThemeComboBox()
        {
            this.cboBackGroundColorTheme.Items.Clear();
            this.cboBackGroundColorTheme.Items.AddRange(TextHighlighterConfigApi.GetAvailableThemes().ToArray());

            var theme = TextHighlighterConfigApi.GetBackGroundColorTheme();

            for (var i = 0; i < this.cboBackGroundColorTheme.Items.Count; i++)
            {
                if (this.cboBackGroundColorTheme.Items[i].ToString() == theme)
                {
                    this.cboBackGroundColorTheme.SelectedIndex = i;
                    break;
                }
            }
            this.lvColor.BackColor      = (theme == "Dark") ? Color.Black : Color.White;
            this.cboColorList.BackColor = this.lvColor.BackColor;
        }
Exemple #7
0
 private void label2_DoubleClick(object sender, EventArgs e)
 {
     TextHighlighterConfigApi.OpenExtensionFolder();
 }
Exemple #8
0
 private void butEditColorConfig_Click(object sender, EventArgs e)
 {
     TextHighlighterConfigApi.OpenColorDefinitionFileInTextEditor();
 }
 internal void Save()
 {
     TextHighlighterConfigApi.SetJsonRelaxModeAndClosingChar(this.chkJsonRelax.Checked, this.chkInsertClosingChar.Checked, null);
 }
 public void Initialize()
 {
     this.chkJsonRelax.Checked         = TextHighlighterConfigApi.GetRelaxMode();
     this.chkInsertClosingChar.Checked = TextHighlighterConfigApi.GetInsertClosingCharacter();
 }