public void Dispose()
 {
     _timer.Stop();
     if (_tracker != null)
     {
         _tracker = null;
     }
     if (_workerQueue != null)
     {
         _workerQueue = null;
     }
 }
 public SpellingHighlighter(ISpellingChecker spellingChecker, IHighlightRenderingServicesRaw highlightRenderingServices,
                            IDisplayServicesRaw displayServices, IMarkupServicesRaw markupServices, IHTMLDocument4 htmlDocument)
 {
     _spellingChecker            = spellingChecker;
     _highlightRenderingServices = highlightRenderingServices;
     _displayServices            = displayServices;
     _markupServicesRaw          = markupServices;
     _markupServices             = new MshtmlMarkupServices(_markupServicesRaw);
     _htmlDocument = htmlDocument;
     _tracker      = new HighlightSegmentTracker();
     //the timer to handle interleaving of spell checking
     _timer = new SpellingTimer(TIMER_INTERVAL);
     _timer.Start();
     _timer.Tick += new EventHandler(_timer_Tick);
     _workerQueue = new Queue();
 }