private void StopHighlighter() { if (_highlighter != null) { _highlighter.Dispose(); _highlighter = null; ClearHighlighting(); } }
private void StopHighlighter() { if (_highlighter == null) { return; } _highlighter.Dispose(); _highlighter = null; ClearHighlighting(); }
/// <summary> /// Creates and initializes a new source document with the given compiler. /// </summary> public SourceDocument(ASMCompiler compiler) { this.Compiler = compiler; InitializeComponent(); Font = new Font(Font.FontFamily.Name, 30f); // Setup the highlighter. m_highlighter = new FastColoredTextBoxHighlighter(this.ContentEditor, this.Compiler.Language); m_highlighter.TextBox.PaintLine += TextBox_PaintLine; ; }
private void StartHighlighter(QabcIronyParser parser) { if (_highlighter != null) { StopHighlighter(); } if (parser != null && parser.Language.CanParse()) { _highlighter = new FastColoredTextBoxHighlighter(txtMusicString, parser.Language); _highlighter.Adapter.Activate(); } }
private void StartHighlighter() { if (_highlighter != null) { StopHighlighter(); } if (chkDisableHili.Checked) { return; } if (!_parser.Language.CanParse()) { return; } _highlighter = new FastColoredTextBoxHighlighter(txtSource, _language); _highlighter.Adapter.Activate(); }
public MainWindow() { InitializeComponent(); //Set up the Irony FCTB _textBox = new IronyTextBox(); _textBox.FastColoredTextBox.BackColor = System.Drawing.Color.FromArgb(255, 30, 30, 30); _textBox.FastColoredTextBox.ForeColor = System.Drawing.Color.White; _textBox.FastColoredTextBox.SelectionColor = System.Drawing.Color.FromArgb(150, 50, 180, 200); _textBox.FastColoredTextBox.CaretColor = System.Drawing.Color.White; _textBox.FastColoredTextBox.Zoom = 125; textBoxHolder.Child = _textBox; _textBox.FastColoredTextBox.ChangeFontSize(2); _textBox.Load += (s, e) => _textBox.FastColoredTextBox.Focus(); var colorSettings = new ColorSettings() { Default = new TextStyle(ColorUtil.RGB(255, 255, 255), null, System.Drawing.FontStyle.Regular), Comment = new TextStyle(ColorUtil.RGB(90, 160, 70), null, System.Drawing.FontStyle.Regular), Keyword = new TextStyle(ColorUtil.RGB(60, 130, 170), null, System.Drawing.FontStyle.Regular), Identifier = new TextStyle(ColorUtil.RGB(170, 200, 220), null, System.Drawing.FontStyle.Regular), Number = new TextStyle(ColorUtil.RGB(180, 200, 155), null, System.Drawing.FontStyle.Regular), String = new TextStyle(ColorUtil.RGB(215, 160, 130), null, System.Drawing.FontStyle.Regular), Text = new TextStyle(ColorUtil.RGB(255, 255, 255), null, System.Drawing.FontStyle.Regular), }; _highlighter = new FastColoredTextBoxHighlighter(_textBox.FastColoredTextBox, new Irony.Parsing.LanguageData(new TplGrammar()), colorSettings); _highlighter.Adapter.Activate(); //Auto Save AppDomain.CurrentDomain.ProcessExit += (s, e) => File.WriteAllText(_tempPath, _textBox.Text); if (File.Exists(_tempPath)) { _textBox.Text = File.ReadAllText(_tempPath); } }
private void StartHighlighter() { _highlighter = new FastColoredTextBoxHighlighter(InputTextBox, m_CuLe.GetLanguage()); _highlighter.Adapter.Activate(); }