Пример #1
0
 /// <summary>
 ///     Raises the <see cref="AnnotationChanged" /> event.
 /// </summary>
 /// <param name="e">An <see cref="AnnotationChangedEventArgs" /> that contains the event data.</param>
 protected virtual void OnAnnotationChanged(AnnotationChangedEventArgs e)
 {
     EventHandler<AnnotationChangedEventArgs> handler = Events[_annotationChangedEventKey] as EventHandler<AnnotationChangedEventArgs>;
     if (handler != null)
         handler(this, e);
 }
Пример #2
0
 private void ScnModified(ref NativeMethods.SCNotification scn)
 {
     if ((scn.modificationType & NativeMethods.SC_MOD_CHANGEANNOTATION) == NativeMethods.SC_MOD_CHANGEANNOTATION)
     {
         AnnotationChangedEventArgs acea = new AnnotationChangedEventArgs(scn.line, scn.annotationLinesAdded);
         OnAnnotationChanged(acea);
     }
 }
Пример #3
0
        private void ScnModified(ref NativeMethods.SCNotification scn)
        {
            // The Scintilla documentation would suggest that the SCEN_CHANGE notification is identical to the
            // standard edit control change notification... but that is entire untrue. In Scintilla it gets fired
            // *before* and *after* a change is made. Twice! So, to get a TextChanged event more similar to
            // standard .NET controls we use SC_MOD_INSERTTEXT and SC_MOD_DELETETEXT instead.

            bool textChanged = false;
            textChanged |= ((scn.modificationType & NativeMethods.SC_MOD_INSERTTEXT) == NativeMethods.SC_MOD_INSERTTEXT);
            textChanged |= ((scn.modificationType & NativeMethods.SC_MOD_DELETETEXT) == NativeMethods.SC_MOD_DELETETEXT);
            if (textChanged)
                OnTextChanged(EventArgs.Empty);

            if ((scn.modificationType & NativeMethods.SC_MOD_CHANGEANNOTATION) == NativeMethods.SC_MOD_CHANGEANNOTATION)
            {
                AnnotationChangedEventArgs acea = new AnnotationChangedEventArgs(scn.line, scn.annotationLinesAdded);
                OnAnnotationChanged(acea);
            }
        }