Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new DocumentHighlighter instance.
 /// </summary>
 public DocumentHighlighter(ReadOnlyDocument document, IHighlightingDefinition definition)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     if (definition == null)
     {
         throw new ArgumentNullException("definition");
     }
     this.document   = document;
     this.definition = definition;
     this.engine     = new HighlightingEngine(definition.MainRuleSet);
     InvalidateHighlighting();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new DocumentHighlighter instance.
 /// </summary>
 public DocumentHighlighter(TextDocument document, IHighlightingDefinition definition)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     if (definition == null)
     {
         throw new ArgumentNullException("definition");
     }
     this.document   = document;
     this.definition = definition;
     this.engine     = new HighlightingEngine(definition.MainRuleSet);
     document.VerifyAccess();
     weakLineTracker = WeakLineTracker.Register(document, this);
     InvalidateSpanStacks();
 }