public void Save() { this.UpdateModel(this.cboFileExtension.Text); TextHighlighterConfigApi.GlobalColorDefinition.Save(); TextHighlighterConfigApi.PurgeGlobalColorDefinition(); TextHighlighterExtension.ConfigurationEngine.Refresh(); }
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); }
private TextHighlighterColorDefinition.FileColorDefinitionSet GetSelectedFileColorDefinitionSet() { if (cboFileExtension.SelectedIndex == -1) { return(null); } return(TextHighlighterConfigApi.GetFileColorDefinitionSet(cboFileExtension.Text)); }
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(); }
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(); } }
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; }
private void label2_DoubleClick(object sender, EventArgs e) { TextHighlighterConfigApi.OpenExtensionFolder(); }
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(); }