Esempio n. 1
0
        //adds a segment to the list
        //used when a misspelled word is found
        public void AddSegment(IHighlightSegmentRaw segment, string wordHere, IMarkupServicesRaw markupServices)
        {
            IMarkupPointerRaw start, end;

            markupServices.CreateMarkupPointer(out start);
            markupServices.CreateMarkupPointer(out end);
            segment.GetPointers(start, end);
            if (!list.ContainsKey(start))
            {
                list.Add(start, new SegmentDef(segment, start, end, wordHere));
            }
        }
 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 ghecking
     _timer = new SpellingTimer(TIMER_INTERVAL);
     _timer.Start();
     _timer.Tick += new EventHandler(_timer_Tick);
     _workerQueue = new Queue();
 }
 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();
 }
        internal static void Clear(IMarkupServicesRaw markupServices)
        {
            if (cache == null)
            {
                return;
            }

            try
            {
                lock (cache.SyncRoot)
                {
                    cache.Remove(GetDocumentKey(markupServices));
                }
            }
            catch (Exception)
            {
                cache = null;
            }
        }
Esempio n. 5
0
 // Begins Undo Unit
 public UndoUnit(HTMLDocument document, string title)
 {
     markupServices = document as IMarkupServicesRaw;
     markupServices.BeginUndoUnit(title);
 }
 public MshtmlMarkupServices(IMarkupServicesRaw markupServices)
 {
     MarkupServices = markupServices;
 }
Esempio n. 7
0
 public MshtmlMarkupServices(IMarkupServicesRaw markupServices)
 {
     MarkupServices = markupServices;
 }
 private static int GetDocumentKey(IMarkupServicesRaw markupServices)
 {
     return(markupServices.GetHashCode());
 }