private void Document_HighlightsUpdated(object sender, Rectangle bb)
        {
            _eventCaptureSurface?.Dispose();
            var spec = new HighlightSpec(_eventCaptureSurfaceStyle, bb);

            _eventCaptureSurface = HtmlHighlight.Create(this.MshtmlDocument, spec, OnMouseDownCallback, OnMouseMoveCallback, OnMouseUpCallback);
        }
        protected override void CreateSelectionBox(Rectangle boundingBox)
        {
            var spec = new HighlightSpec(_selectionBoxStyle, boundingBox);

            _selectionBox?.Dispose();
            _selectionBox = HtmlHighlight.Create(this.MshtmlDocument, spec);
        }
 public WebBrowserControl()
 {
     this.InitializeComponent();
     _renderTimeout             = new Configuration().RENDER_TIME_OUT;
     _timer                     = this.CreateTimer();
     _eventCaptureSurfaceStyle  = new HighlightStyleFactory().CreateEventCaptureSurfaceStyle();
     _eventCaptureSurface       = null;
     _selectionBox              = null;
     _wpfControl.LoadCompleted += WpfControl_LoadCompleted;
 }
示例#4
0
        public void ShowHighlights(ZoneTree tree, IEnumerable <HighlightSpec> highlightSpecs)
        {
            var toRemove = _highlights.Except(highlightSpecs).ToArray();

            foreach (HtmlHighlight highlight in toRemove)
            {
                highlight.Remove();
                _highlights.Remove(highlight);
            }

            var toAdd = highlightSpecs.Except(_highlights);

            foreach (var spec in toAdd)
            {
                var highlight = HtmlHighlight.Create(_msDoc, spec);
                _highlights.Add(highlight);
            }

            var verticalScrollAreas = this.GetVerticalScrollArea(tree);

            this.NotifyHighlightsUpdated(verticalScrollAreas);
        }
 protected override void RemoveSelectionBox()
 {
     _selectionBox?.Dispose();
     _selectionBox = null;
 }