Esempio n. 1
0
        public void MarkElement(HtmlElement targetEl)
        {
            try
            {
                HtmlDocument htmlDoc = this._webBrowser.Document;
                HtmlElement  html    = htmlDoc.Body.Parent;

                this._methodBeforeAddBehavior(targetEl);

                if (this._currentElement != null && this._currentElement.Equals(targetEl))
                {
                    return;
                }

                if (this._currentBehaviorCode > 0)
                {
                    bool flag = ((IHTMLElement2)html.DomElement).removeBehavior(this._currentBehaviorCode);
                    this._currentBehaviorCode = -1;
                }
                this._currentElement = targetEl;

                MarkBehavior currentBehavior = new MarkBehavior();
                currentBehavior.SourceRectangle = this.GetAbsoluteRectangle(targetEl);
                currentBehavior.SourceElement   = (IHTMLElement2)html.DomElement;

                //((HTMLElementEvents_Event)((IHTMLElement)targetEl.DomElement)).onclick += new HTMLElementEvents_onclickEventHandler(this.Element_click);
                try
                {
                    this._elementFixed = false;
                    targetEl.Click    -= new HtmlElementEventHandler(this.Element_click);
                    targetEl.Click    += new HtmlElementEventHandler(this.Element_click);
                }
                catch (Exception ex)
                {
                    //MessageBox.Show(ex.Message);
                    this._methodThrowException(ex.Message);
                }

                object obj = currentBehavior;
                this._currentBehaviorCode = currentBehavior.SourceElement.addBehavior(null, ref obj);
                this._methodAfterAddBehavior(targetEl, currentBehavior);
                this._methodMouseOverOnBrowser(targetEl);
            }
            catch (Exception ex)
            {
                this._methodThrowException(ex.Message);
            }
        }
Esempio n. 2
0
 private void methodAfterAddBehavior(HtmlElement element, MarkBehavior markBehavior)
 {
 }
Esempio n. 3
0
 private void methodAfterAddBehavior(HtmlElement element, MarkBehavior markBehavior)
 {
     this._methodAfterAddBehavior(element, markBehavior);
 }
Esempio n. 4
0
 private void methodAfterAddBehavior(HtmlElement element, MarkBehavior markBehavior)
 {
 }
Esempio n. 5
0
 private void methodAfterAddBehavior(HtmlElement element, MarkBehavior markBehavior)
 {
     this._methodAfterAddBehavior(element, markBehavior);
 }
Esempio n. 6
0
        public void MarkElement(HtmlElement targetEl)
        {
            try
            {
                HtmlDocument htmlDoc = this._webBrowser.Document;
                HtmlElement html = htmlDoc.Body.Parent;

                this._methodBeforeAddBehavior(targetEl);

                if (this._currentElement != null && this._currentElement.Equals(targetEl))
                {
                    return;
                }

                if (this._currentBehaviorCode > 0)
                {
                    bool flag = ((IHTMLElement2)html.DomElement).removeBehavior(this._currentBehaviorCode);
                    this._currentBehaviorCode = -1;
                }
                this._currentElement = targetEl;

                MarkBehavior currentBehavior = new MarkBehavior();
                currentBehavior.SourceRectangle = this.GetAbsoluteRectangle(targetEl);
                currentBehavior.SourceElement = (IHTMLElement2)html.DomElement;

                //((HTMLElementEvents_Event)((IHTMLElement)targetEl.DomElement)).onclick += new HTMLElementEvents_onclickEventHandler(this.Element_click);
                try
                {
                    this._elementFixed = false;
                    targetEl.Click -= new HtmlElementEventHandler(this.Element_click);
                    targetEl.Click += new HtmlElementEventHandler(this.Element_click);
                }
                catch (Exception ex)
                {
                    //MessageBox.Show(ex.Message);
                    this._methodThrowException(ex.Message);
                }

                object obj = currentBehavior;
                this._currentBehaviorCode = currentBehavior.SourceElement.addBehavior(null, ref obj);
                this._methodAfterAddBehavior(targetEl, currentBehavior);
                this._methodMouseOverOnBrowser(targetEl);
            }
            catch(Exception ex)
            {
                this._methodThrowException(ex.Message);
            }
        }