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);
        }
Пример #2
0
 protected virtual void OnStyleNeeded(StyleNeededEventArgs e)
 {
     if (Events[_styleNeededEventKey] != null)
         ((EventHandler<StyleNeededEventArgs>)Events[_styleNeededEventKey])(this, e);
 }