/// <summary> /// Raises the <see cref="StyleNeeded"/> event. /// </summary> /// <param name="e">An <see cref="StyleNeededEventArgs"/> that contains the event data.</param> protected virtual void OnStyleNeeded(StyleNeededEventArgs e) { EventHandler<StyleNeededEventArgs> handler = Events[_styleNeededEventKey] as EventHandler<StyleNeededEventArgs>; if (handler != null) handler(this, e); }
internal void FireStyleNeeded(NativeScintillaEventArgs ea) { if(Events[_styleNeededEventKeyNative] != null) ((EventHandler<NativeScintillaEventArgs>)Events[_styleNeededEventKeyNative])(this, ea); // TODO: When this event fires it fires A LOT over and over again if // you don't actually style the document. Additionally I'm making 2 // more calls to Scintilla to get the Start position of the style // range. I need to come up with a good way to supress this logic // unless the client app is actually interested in it. // Now that we've fired the Native event we do the same for the // SourceEdit's StyleNeeded event. This code should look VERY familliar // to anyone who's read the Scintilla Documentation int startPos = _ns.GetEndStyled(); int lineNumber = _ns.LineFromPosition(startPos); startPos = _ns.PositionFromLine(lineNumber); StyleNeededEventArgs snea = new StyleNeededEventArgs(new Range(startPos, ea.SCNotification.position, this)); OnStyleNeeded(snea); }
private void scintilla_StyleNeeded(object sender, StyleNeededEventArgs e) { // Style the text if (_iniLexer) SCide.IniLexer.StyleNeeded((Scintilla)sender, e.Range); }
private void EditorView_StyleNeeded(object sender, StyleNeededEventArgs e) { if (iscustomelexerinit) LexerInitializer.StyleNeeded((Scintilla)sender, e.Range); }