Beispiel #1
0
 void TextEditorControl_DocumentChanged(object sender, DigitalRune.Windows.TextEditor.Document.DocumentEventArgs e)
 {
     if (this.DocumentChangedIgnoredDuringInitialization)
     {
         return;
     }
     if (this.OnTextNotSaved == null)
     {
         return;
     }
     this.OnTextNotSaved(this, new ScriptEditorEventArgs(this.ScriptSourceCode));
 }
 /// <summary>
 /// Raises the <see cref="DocumentChanged"/> event.
 /// </summary>
 /// <param name="documentEventArgs">The <see cref="DigitalRune.Windows.TextEditor.Document.DocumentEventArgs"/> instance containing the event data.</param>
 protected virtual void OnDocumentChanged(DocumentEventArgs documentEventArgs)
 {
   EventHandler<DocumentEventArgs> handler = DocumentChanged;
   if (handler != null)
     handler(this, documentEventArgs);
 }
 private void Document_DocumentChanged(object sender, DocumentEventArgs documentEventArgs)
 {
   OnDocumentChanged(documentEventArgs);
 }
 void AdjustScrollBarsOnDocumentChange(object sender, DocumentEventArgs e)
 {
     if (_motherTextEditorControl.IsInUpdate == false)
       {
     AdjustScrollBarsClearCache();
     AdjustScrollBars();
       }
       else
       {
     _adjustScrollBarsOnNextUpdate = true;
       }
 }
 void DocumentAboutToBeChanged(object sender, DocumentEventArgs e)
 {
   // => startOffset test required so that this startOffset/endOffset are not incremented again
   //    for BeforeStartKey characters
   if (e.Offset >= _startOffset && e.Offset <= _endOffset)
   {
     if (e.Length > 0)
     { 
       // Text has been removed
       _endOffset -= e.Length;
     }
     if (!String.IsNullOrEmpty(e.Text))
     {
       // Text has been added.
       _endOffset += e.Text.Length;
     }
   }
 }
 void DocumentChanged(object sender, DocumentEventArgs e)
 {
   // reset markers table
   markersTable.Clear();
   document.UpdateSegmentListOnDocumentChange(textMarker, e);
 }