public override bool StorePanelContents() { ((IProperties)CustomizationObject).SetProperty("ShowInvalidLines", ((CheckBox)ControlDictionary["showInvalidLinesCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowLineNumbers", ((CheckBox)ControlDictionary["showLineNumberCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowBracketHighlight", ((CheckBox)ControlDictionary["showBracketHighlighterCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowErrors", ((CheckBox)ControlDictionary["showErrorsCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowHRuler", ((CheckBox)ControlDictionary["showHRulerCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowEOLMarkers", ((CheckBox)ControlDictionary["showEOLMarkersCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowVRuler", ((CheckBox)ControlDictionary["showVRulerCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowTabs", ((CheckBox)ControlDictionary["showTabCharsCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("ShowSpaces", ((CheckBox)ControlDictionary["showSpaceCharsCheckBox"]).Checked); try { ((IProperties)CustomizationObject).SetProperty("VRulerRow", Int32.Parse(ControlDictionary["vRulerRowTextBox"].Text)); } catch (Exception) { } ((IProperties)CustomizationObject).SetProperty("LineViewerStyle", (LineViewerStyle)((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).SelectedIndex); ((IProperties)CustomizationObject).SetProperty("BracketMatchingStyle", (BracketMatchingStyle)((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).SelectedIndex); IViewContent content = WorkbenchSingleton.Workbench.ActiveViewContent; if (content != null && (content is TextEditorView)) { TextEditorControl textEditorControl = content.Control as TextEditorControl; textEditorControl.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance; properties.ShowInvalidLines = ((CheckBox)ControlDictionary["showInvalidLinesCheckBox"]).Checked; properties.ShowLineNumbers = ((CheckBox)ControlDictionary["showLineNumberCheckBox"]).Checked; properties.ShowMatchingBracket = ((CheckBox)ControlDictionary["showBracketHighlighterCheckBox"]).Checked; properties.UnderlineErrors = ((CheckBox)ControlDictionary["showErrorsCheckBox"]).Checked; properties.ShowHorizontalRuler = ((CheckBox)ControlDictionary["showHRulerCheckBox"]).Checked; properties.ShowEOLMarker = ((CheckBox)ControlDictionary["showEOLMarkersCheckBox"]).Checked; properties.ShowVerticalRuler = ((CheckBox)ControlDictionary["showVRulerCheckBox"]).Checked; properties.ShowTabs = ((CheckBox)ControlDictionary["showTabCharsCheckBox"]).Checked; properties.ShowSpaces = ((CheckBox)ControlDictionary["showSpaceCharsCheckBox"]).Checked; properties.CaretLine = ((CheckBox)ControlDictionary["showCaretLineCheckBox"]).Checked; try { properties.VerticalRulerRow = Int32.Parse(ControlDictionary["vRulerRowTextBox"].Text); } catch (Exception) { } properties.LineViewerStyle = (LineViewerStyle)((ComboBox)ControlDictionary["lineMarkerStyleComboBox"]).SelectedIndex; properties.BracketMatchingStyle = (BracketMatchingStyle)((ComboBox)ControlDictionary["bracketMatchingStyleComboBox"]).SelectedIndex; IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent; if (activeViewContent is ITextEditorControlProvider) { TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl; textarea.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance; if (((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Enabled) { properties.TextRenderingHint = ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked ? TextRenderingHint.ClearTypeGridFit : TextRenderingHint.SystemDefault; } else { properties.TextRenderingHint = TextRenderingHint.SystemDefault; } properties.MouseWheelTextZoom = ((CheckBox)ControlDictionary["mouseWheelZoomCheckBox"]).Checked; //((Properties)CustomizationObject).Set("EnableCodeCompletion", ((CheckBox)ControlDictionary["enableCodeCompletionCheckBox"]).Checked); properties.EnableFolding = ((CheckBox)ControlDictionary["enableFoldingCheckBox"]).Checked; Font currentFont = CurrentFont; if (currentFont != null) { properties.Font = currentFont; } properties.EncodingCodePage = CharacterEncodings.GetCodePageByIndex(((ComboBox)ControlDictionary["textEncodingComboBox"]).SelectedIndex); properties.ShowQuickClassBrowserPanel = ((CheckBox)ControlDictionary["showQuickClassBrowserCheckBox"]).Checked; IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent; if (activeViewContent is ITextEditorControlProvider) { TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl; textarea.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { ((Properties)CustomizationObject).Set("DoubleBuffer", ((CheckBox)ControlDictionary["enableDoublebufferingCheckBox"]).Checked); ((Properties)CustomizationObject).Set("UseAntiAliasFont", ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked); ((Properties)CustomizationObject).Set("MouseWheelTextZoom", ((CheckBox)ControlDictionary["mouseWheelZoomCheckBox"]).Checked); //((Properties)CustomizationObject).Set("EnableCodeCompletion", ((CheckBox)ControlDictionary["enableCodeCompletionCheckBox"]).Checked); ((Properties)CustomizationObject).Set("EnableFolding", ((CheckBox)ControlDictionary["enableFoldingCheckBox"]).Checked); Font currentFont = CurrentFont; if (currentFont != null) { ((Properties)CustomizationObject).Set("DefaultFont", currentFont.ToString()); } ((Properties)CustomizationObject).Set("Encoding", CharacterEncodings.GetCodePageByIndex(((ComboBox)ControlDictionary["textEncodingComboBox"]).SelectedIndex)); ((Properties)CustomizationObject).Set("ShowQuickClassBrowserPanel", ((CheckBox)ControlDictionary["showQuickClassBrowserCheckBox"]).Checked); IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; if (window != null && (window.ViewContent is ITextEditorControlProvider)) { TextEditorControl textarea = ((ITextEditorControlProvider)window.ViewContent).TextEditorControl; textarea.OptionsChanged(); } return(true); }
public void ReloadSettings() { string fontName = SettingsManager.ReadValue <string>("FontName"); float fontSize = SettingsManager.ReadValue <float>("FontSize"); textEditorControl.AllowCaretBeyondEOL = SettingsManager.ReadValue <bool>("AllowCaretBeyondEOL"); textEditorControl.ConvertTabsToSpaces = SettingsManager.ReadValue <bool>("ConvertTabsToSpaces"); textEditorControl.EnableFolding = SettingsManager.ReadValue <bool>("EnableFolding"); textEditorControl.ShowEOLMarkers = SettingsManager.ReadValue <bool>("ShowEOLMarkers"); textEditorControl.ShowHRuler = SettingsManager.ReadValue <bool>("ShowHRuler"); textEditorControl.ShowInvalidLines = SettingsManager.ReadValue <bool>("ShowInvalidLines"); textEditorControl.ShowLineNumbers = SettingsManager.ReadValue <bool>("ShowLineNumbers"); textEditorControl.ShowMatchingBracket = SettingsManager.ReadValue <bool>("ShowMatchingBrackets"); textEditorControl.ShowSpaces = SettingsManager.ReadValue <bool>("ShowSpaces"); textEditorControl.ShowTabs = SettingsManager.ReadValue <bool>("ShowTabs"); textEditorControl.ShowVRuler = SettingsManager.ReadValue <bool>("ShowVRuler"); if (fontName != string.Empty && fontSize > 0) { try { textEditorControl.Font = new Font(new FontFamily(fontName), fontSize, FontStyle.Regular); } catch (Exception ex) { textEditorControl.Font = new Font(FontFamily.GenericMonospace, 9.75f, FontStyle.Regular); string err = ex.Message; } } if (SettingsManager.ReadValue <bool>("HighlightCurrentLine")) { textEditorControl.LineViewerStyle = LineViewerStyle.FullRow; } if (SettingsManager.ReadValue <string>("IndentStyle") == "Smart") { textEditorControl.IndentStyle = IndentStyle.Smart; } if (SettingsManager.ReadValue <string>("IndentStyle") == "Auto") { textEditorControl.IndentStyle = IndentStyle.Auto; } if (SettingsManager.ReadValue <string>("IndentStyle") == "None") { textEditorControl.IndentStyle = IndentStyle.None; } if (SettingsManager.ReadValue <bool>("AutoInsertBrackets")) { textEditorControl.ActiveTextAreaControl.TextEditorProperties.AutoInsertCurlyBracket = true; } textEditorControl.OptionsChanged(); }
public void ReloadSettings() { EditorConfigurationSection section = cfg.GetEditorConfiguration(); string fontName = section.FontName.Value; float fontSize = section.FontSize.Value; textEditorControl.AllowCaretBeyondEOL = section.AllowCaretBeyondEOL.Value; textEditorControl.ConvertTabsToSpaces = section.ConvertTabsToSpaces.Value; textEditorControl.EnableFolding = section.EnableFolding.Value; textEditorControl.ShowEOLMarkers = section.ShowEOLMarkers.Value; textEditorControl.ShowHRuler = section.ShowHRuler.Value; textEditorControl.ShowInvalidLines = section.ShowInvalidLines.Value; textEditorControl.ShowLineNumbers = section.ShowLineNumbers.Value; textEditorControl.ShowMatchingBracket = section.ShowMatchingBrackets.Value; textEditorControl.ShowSpaces = section.ShowSpaces.Value; textEditorControl.ShowTabs = section.ShowTabs.Value; textEditorControl.ShowVRuler = section.ShowVRuler.Value; if (fontName != string.Empty && fontSize > 0) { try { textEditorControl.Font = new Font(new FontFamily(fontName), fontSize, FontStyle.Regular); } catch (Exception ex) { textEditorControl.Font = new Font(FontFamily.GenericMonospace, 9.75f, FontStyle.Regular); string err = ex.Message; } } if (section.HighlightCurrentLine.Value) { textEditorControl.LineViewerStyle = LineViewerStyle.FullRow; } if (section.IndentStyle.Value == "Smart") { textEditorControl.IndentStyle = IndentStyle.Smart; } if (section.IndentStyle.Value == "Auto") { textEditorControl.IndentStyle = IndentStyle.Auto; } if (section.IndentStyle.Value == "None") { textEditorControl.IndentStyle = IndentStyle.None; } if (section.AutoInsertBrackets.Value) { textEditorControl.ActiveTextAreaControl.TextEditorProperties.AutoInsertCurlyBracket = true; } textEditorControl.OptionsChanged(); }
public override bool StorePanelContents() { SharpDevelopTextEditorProperties properties = SharpDevelopTextEditorProperties.Instance; properties.ConvertTabsToSpaces = ((CheckBox)ControlDictionary["convertTabsToSpacesCheckBox"]).Checked; properties.MouseWheelScrollDown = ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).SelectedIndex == 0; properties.AutoInsertCurlyBracket = ((CheckBox)ControlDictionary["autoinsertCurlyBraceCheckBox"]).Checked; properties.HideMouseCursor = ((CheckBox)ControlDictionary["hideMouseCursorCheckBox"]).Checked; properties.AllowCaretBeyondEOL = ((CheckBox)ControlDictionary["caretBehindEOLCheckBox"]).Checked; properties.AutoInsertTemplates = ((CheckBox)ControlDictionary["auotInsertTemplatesCheckBox"]).Checked; properties.CutCopyWholeLine = ((CheckBox)ControlDictionary["cutCopyWholeLine"]).Checked; properties.IndentStyle = (IndentStyle)((ComboBox)ControlDictionary["indentStyleComboBox"]).SelectedIndex; try { int tabSize = Int32.Parse(ControlDictionary["tabSizeTextBox"].Text); // FIX: don't allow to set tab size to zero as this will cause divide by zero exceptions in the text control. // Zero isn't a setting that makes sense, anyway. if (tabSize > 0) { properties.TabIndent = tabSize; } } catch (Exception) { } try { properties.IndentationSize = Int32.Parse(ControlDictionary["indentSizeTextBox"].Text); } catch (Exception) { } IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent; if (activeViewContent is ITextEditorControlProvider) { TextEditorControl textarea = ((ITextEditorControlProvider)activeViewContent).TextEditorControl; textarea.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { ((Properties)CustomizationObject).Set("TabsToSpaces", ((CheckBox)ControlDictionary["convertTabsToSpacesCheckBox"]).Checked); ((Properties)CustomizationObject).Set("MouseWheelScrollDown", ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).SelectedIndex == 0); ((Properties)CustomizationObject).Set("AutoInsertCurlyBracket", ((CheckBox)ControlDictionary["autoinsertCurlyBraceCheckBox"]).Checked); ((Properties)CustomizationObject).Set("HideMouseCursor", ((CheckBox)ControlDictionary["hideMouseCursorCheckBox"]).Checked); ((Properties)CustomizationObject).Set("CursorBehindEOL", ((CheckBox)ControlDictionary["caretBehindEOLCheckBox"]).Checked); ((Properties)CustomizationObject).Set("AutoInsertTemplates", ((CheckBox)ControlDictionary["auotInsertTemplatesCheckBox"]).Checked); ((Properties)CustomizationObject).Set("CutCopyWholeLine", ((CheckBox)ControlDictionary["cutCopyWholeLine"]).Checked); ((Properties)CustomizationObject).Set("IndentStyle", (IndentStyle)((ComboBox)ControlDictionary["indentStyleComboBox"]).SelectedIndex); try { int tabSize = Int32.Parse(ControlDictionary["tabSizeTextBox"].Text); // FIX: don't allow to set tab size to zero as this will cause divide by zero exceptions in the text control. // Zero isn't a setting that makes sense, anyway. if (tabSize > 0) { ((Properties)CustomizationObject).Set("TabIndent", tabSize); } } catch (Exception) { } try { ((Properties)CustomizationObject).Set("IndentationSize", Int32.Parse(ControlDictionary["indentSizeTextBox"].Text)); } catch (Exception) { } IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; if (window != null && (window.ViewContent is ITextEditorControlProvider)) { TextEditorControl textarea = ((ITextEditorControlProvider)window.ViewContent).TextEditorControl; textarea.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { ((IProperties)CustomizationObject).SetProperty("DoubleBuffer", ((CheckBox)ControlDictionary["enableDoublebufferingCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("UseAntiAliasFont", ((CheckBox)ControlDictionary["enableAAFontRenderingCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("MouseWheelTextZoom", ((CheckBox)ControlDictionary["mouseWheelZoomCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("EnableCodeCompletion", ((CheckBox)ControlDictionary["enableCodeCompletionCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("EnableFolding", ((CheckBox)ControlDictionary["enableFoldingCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("DefaultFont", CurrentFont.ToString()); ((IProperties)CustomizationObject).SetProperty("Encoding", CharacterEncodings.GetCodePageByIndex(((ComboBox)ControlDictionary["textEncodingComboBox"]).SelectedIndex)); ((IProperties)CustomizationObject).SetProperty("ShowQuickClassBrowserPanel", ((CheckBox)ControlDictionary["showQuickClassBrowserCheckBox"]).Checked); IViewContent content = WorkbenchSingleton.Workbench.ActiveViewContent; if (content != null && (content is TextEditorView)) { TextEditorControl textEditorContorl = content.Control as TextEditorControl; textEditorContorl.OptionsChanged(); } return(true); }
public override bool StorePanelContents() { ((IProperties)CustomizationObject).SetProperty("TabsToSpaces", ((CheckBox)ControlDictionary["convertTabsToSpacesCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("MouseWheelScrollDown", ((ComboBox)ControlDictionary["mouseWhellDirectionComboBox"]).SelectedIndex == 0); ((IProperties)CustomizationObject).SetProperty("AutoInsertCurlyBracket", ((CheckBox)ControlDictionary["autoinsertCurlyBraceCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("HideMouseCursor", ((CheckBox)ControlDictionary["hideMouseCursorCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("CursorBehindEOL", ((CheckBox)ControlDictionary["caretBehindEOLCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("AutoInsertTemplates", ((CheckBox)ControlDictionary["auotInsertTemplatesCheckBox"]).Checked); ((IProperties)CustomizationObject).SetProperty("IndentStyle", ((ComboBox)ControlDictionary["indentStyleComboBox"]).SelectedIndex); try { int tabSize = Int32.Parse(ControlDictionary["tabSizeTextBox"].Text); //这里要求tabSize>0 ,因为如果为零,就会出现被零除的异常,这没有意义。 if (tabSize > 0) { ((IProperties)CustomizationObject).SetProperty("TabIndent", tabSize); } } catch (Exception) { } try { ((IProperties)CustomizationObject).SetProperty("IndentationSize", Int32.Parse(ControlDictionary["indentSizeTextBox"].Text)); } catch (Exception) { } IViewContent content = WorkbenchSingleton.Workbench.ActiveViewContent; if (content != null && (content is TextEditorView)) { TextEditorControl textarea = content.Control as TextEditorControl; textarea.OptionsChanged(); } return(true); }
public FlowchartTE(Procedure cProc, TabInfo ti, List <string> allNodes = null, bool fromDiagram = false) { InitializeComponent(); this.sourceTab = ti; OpenFromDiagram = fromDiagram; //Create the text editor TextEditorControl te = new TextEditorControl(); //te.TextEditorProperties.NativeDrawText = Settings.winAPITextRender; te.TextEditorProperties.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; Settings.SetTextAreaFont(te); //te.AllowCaretBeyondEOL = true; te.EnableFolding = false; te.BorderStyle = BorderStyle.FixedSingle; te.LineViewerStyle = LineViewerStyle.FullRow; te.ShowVRuler = false; te.TextEditorProperties.IndentStyle = IndentStyle.Smart; te.TextEditorProperties.ConvertTabsToSpaces = Settings.tabsToSpaces; te.TextEditorProperties.TabIndent = Settings.tabSize; te.TextEditorProperties.IndentationSize = Settings.tabSize; // Activate the highlighting, use the name from the SyntaxDefinition node. te.TextEditorProperties.DarkScheme = ColorTheme.IsDarkTheme; te.SetHighlighting(ColorTheme.HighlightingScheme); te.OptionsChanged(); te.Text = GetProcedureCode(ti.textEditor.Document, cProc); textEditor = te; // events te.TextChanged += CodeChangedTimer; te.ActiveTextAreaControl.TextArea.ToolTipRequest += TextArea_ToolTipRequest; te.ActiveTextAreaControl.TextArea.PreviewKeyDown += delegate(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Tab) { if (Utilities.AutoCompleteKeyWord(textEditor.ActiveTextAreaControl)) { e.IsInputKey = true; } } }; te.ActiveTextAreaControl.Caret.PositionChanged += delegate(object sender, EventArgs e) { Utilities.SelectedTextColorRegion(new TextLocation(), textEditor.ActiveTextAreaControl); }; //te.ActiveTextAreaControl.TextArea.MouseDown += delegate(object sender, MouseEventArgs e) { // if (e.Button == MouseButtons.Left) // Utilities.SelectedTextColorRegion(textEditor.ActiveTextAreaControl); //}; splitContainer.Panel1.Controls.Add(te); cForm = new Form(); cForm.ClientSize = this.Size; cForm.Controls.Add(this); cForm.FormBorderStyle = FormBorderStyle.Sizable; cForm.StartPosition = FormStartPosition.CenterScreen; cForm.Icon = Properties.Resources.CodeText; NodeName = cProc.name; cForm.FormClosing += cForm_FormClosing; te.Dock = DockStyle.Fill; this.Dock = DockStyle.Fill; timer.Tick += CodeChanged; if (allNodes == null) { allNodes = DialogueParser.GetAllNodesName(PI.procs); } cmbNodesName.Items.AddRange(allNodes.ToArray()); cmbNodesName.SelectedIndex = 0; LoadCustomCode(); ParseCode(); dgvMessages.ClearSelection(); }
public override void RedrawContent() { textEditorControl.OptionsChanged(); textEditorControl.Refresh(); }