コード例 #1
0
        public int PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            // EventType [mouseover, mouseout, mousemove, mouseup]
            // When clicked something, check if it is module or not
            if (pIEventObj.EventType == "mousedown")
            {
                IHTMLElement module;
                if (isModule(pIEventObj.SrcElement, out module))
                {
                    // Fire event
                    ElementDataEventArgs args = new ElementDataEventArgs();
                    args.element = module;
                    args.eventObj = pIEventObj;
                    this.moduleClicked(this, args);
                    // And deny the rest
                    return HRESULT.S_OK;
                }
                else
                {
                    ElementDataEventArgs args = new ElementDataEventArgs();
                    args.element = pIEventObj.SrcElement;
                    args.eventObj = pIEventObj;
                    this.canvasClicked(this, args);
                }
            }

            return HRESULT.S_FALSE;
        }
コード例 #2
0
        private int _editorContext_PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            try
            {
                switch (inEvtDispId)
                {
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE:
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN:
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEUP:
                        return HandleMouseEvent(inEvtDispId, pIEventObj);

                    default:
                        return HRESULT.S_FALSE;
                }
            }
            catch (Exception ex)
            {
                // log error
                Trace.Fail("Unexpected error during TableColumnSizeEditor PreHandleEvent: " + ex.ToString());

                // reset state
                _sizingOperation.EndSizing();

                // event not handled
                return HRESULT.S_FALSE;
            }
        }
コード例 #3
0
 public void ResetParameters(HTMLEventType EventType, HTMLEventDispIds DispID, IHTMLEventObj pEvtObj)
 {
     this.Cancel = false;
     this.m_EventDispId = DispID;
     m_pEvtObj = pEvtObj;
     m_EventType = EventType;
 }
コード例 #4
0
 ///Define the original source format
 ///Finder:Way:Value;Action:ActionType:Value
 /// <summary>
 /// 
 /// </summary>
 /// <param name="obj"></param>
 public static void _click(IHTMLEventObj obj)
 {
     string identify = GetIdentify(obj.srcElement);
     identify += "action : click" + System.Environment.NewLine;
     sb.Append(identify);
     obj.srcElement.click();
 }
コード例 #5
0
        private int HandleMouseEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            // WinLive 160252: MSHTML throws a COMException with HRESULT 0x8000FFFF (E_UNEXPECTED) when calling
            // IHTMLPaintSite.TransformGlobalToLocal if the table has no height.
            IHTMLElement tableElement = (IHTMLElement)_table;
            if (tableElement.offsetHeight <= 0 || tableElement.offsetWidth <= 0)
            {
                return HRESULT.S_FALSE;
            }

            // compute the element local coordinates of the point
            POINT clientMouseLocation = new POINT();
            clientMouseLocation.x = pIEventObj.clientX;
            clientMouseLocation.y = pIEventObj.clientY;
            POINT localMouseLocation = new POINT();
            _paintSite.TransformGlobalToLocal(clientMouseLocation, ref localMouseLocation);

            // determine if the point is within our bounds
            int tableWidth = tableElement.offsetWidth + 4; // extra padding for mouse handling at right edge
            Rectangle elementBounds = new Rectangle(-1, -1, tableWidth, tableElement.offsetHeight + 1);
            bool mouseInElement = elementBounds.Contains(localMouseLocation.x, localMouseLocation.y);

            if (mouseInElement || _sizingOperation.InProgress)
            {
                // create args
                TableColumnMouseEventArgs mouseEventArgs = new TableColumnMouseEventArgs(
                    new Point(clientMouseLocation.x, clientMouseLocation.y),
                    new Point(localMouseLocation.x, localMouseLocation.y));

                // fire the event
                switch (inEvtDispId)
                {
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE:
                        OnMouseMove(mouseEventArgs);
                        break;
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN:
                        OnMouseDown(mouseEventArgs);
                        break;
                    case DISPID_HTMLELEMENTEVENTS2.ONMOUSEUP:
                        OnMouseUp(mouseEventArgs);
                        break;
                    default:
                        Trace.Fail("unexpected event id");
                        break;
                }

                // indicate whether we should mask the event from the editor
                return mouseEventArgs.Handled ? HRESULT.S_OK : HRESULT.S_FALSE;

            }
            else
            {
                // if the mouse is not inside the element the end sizing
                _sizingOperation.EndSizing();
            }

            // event not handled
            return HRESULT.S_FALSE;
        }
コード例 #6
0
 bool HTMLSelectElementEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (selectonhelp != null)
     {
         HTMLSelectElementEventArgs args = new HTMLSelectElementEventArgs(pEvtObj);
         selectonhelp(this, args);
         return args.AllowDefault;
     }
     else
         return true; //Allow, default
 }
コード例 #7
0
 bool HTMLDocumentEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (doconhelp != null)
     {
         HTMLDocumentEventArgs arg = new HTMLDocumentEventArgs(pEvtObj);
         doconhelp(this, arg);
         return arg.AllowDefault;
     }
     else
         return true; //Allow, default
 }
コード例 #8
0
 bool HTMLScriptEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (scriptonhelp != null)
     {
         HTMLScriptEventArgs arg = new HTMLScriptEventArgs(pEvtObj);
         scriptonhelp(this, arg);
         return arg.AllowDefault;
     }
     else
         return true;
 }
コード例 #9
0
        /// <summary>
        /// Pre-process mouse messages to detect drag-and-drop of selections
        /// </summary>
        /// <param name="inEvtDispId">event id</param>
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_FALSE to continue default processing, S_OK to prevent further processing</returns>
        internal int PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            switch (inEvtDispId)
            {
                // pre-handle mouse events
                case DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN:
                    return PreHandleMouseDown(inEvtDispId, pIEventObj);
                case DISPID_HTMLELEMENTEVENTS2.ONMOUSEUP:
                    return PreHandleMouseUp(inEvtDispId, pIEventObj);
                case DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE:
                    return PreHandleMouseMove(inEvtDispId, pIEventObj);

                // allow all other events to pass through
                default:
                    return HRESULT.S_FALSE;
            }
        }
コード例 #10
0
        protected override int HandlePreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            if (ShouldProcessEvents(inEvtDispId, pIEventObj))
            {
                if (_dragDropController.PreHandleEvent(inEvtDispId, pIEventObj) == HRESULT.S_OK)
                    return HRESULT.S_OK;

                if (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN && (Control.MouseButtons & MouseButtons.Right) > 0)
                {
                    // Select the disabled image so that the context menu shows up correctly.
                    EditorContext.Selection = DisabledImageSelection.SelectElement(EditorContext, HTMLElement);
                    return HRESULT.S_OK;
                }
            }

            return HRESULT.S_FALSE;
        }
コード例 #11
0
        /// <summary>
        /// Processes the keystroke event.
        /// </summary>
        /// <param name="inEvtDispId">The dispatch id of the event.</param>
        /// <param name="pIEventObj">The event object.</param>
        /// <returns>A KeyEventArgs object with the current state of the RTL accelerator keys. This can be null if there was nothing to process.</returns>
        public KeyEventArgs ProcessEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            Keys currentKey = (Keys)pIEventObj.keyCode;
            KeyEventArgs e = null;

            if (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONKEYDOWN)
            {
                if (currentKey == Keys.ControlKey)
                {
                    this.ctrlDown = true;
                }
                else if (currentKey == Keys.ShiftKey)
                {
                    // The first shift key down is the one we'll track.
                    if (((IHTMLEventObj3)pIEventObj).shiftLeft && !this.rightShiftDown)
                    {
                        this.leftShiftDown = true;
                    }
                    else if (!this.leftShiftDown)
                    {
                        this.rightShiftDown = true;
                    }
                }
                else
                {
                    // If any other keystrokes beside CTRL and SHIFT are pressed, stop tracking the keystrokes we've
                    // seen. For example, a user might hit CTRL+SHIFT+LEFT to start highlighting a word and we don't
                    // want that to trigger the RTL/LTR command.
                    this.Reset();
                }
            }
            else if (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONKEYUP)
            {
                // We always want to fire an event if CTRL goes up with SHIFT still pressed or vice-versa so that
                // MSHTML doesn't attempt to handle the keystrokes.
                if ((currentKey == Keys.ControlKey && pIEventObj.shiftKey) || (currentKey == Keys.ShiftKey && pIEventObj.ctrlKey))
                {
                    e = this.GetKeyEventArgs();
                }

                this.Reset();
            }

            return e;
        }
コード例 #12
0
        public void _click(IHTMLEventObj obj)
        {
            try
            {

                string identify = GetIdentify(obj.srcElement);

                identify += "; CLICK";

                StepRecorder.RecordStep(UserBar.instance.SteptreeView, identify);

                obj.srcElement.click();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #13
0
        // <summary>
        /// Pre-process mouse messages to detect drag-and-drop of selections
        /// </summary>
        /// <param name="inEvtDispId">event id</param>
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_FALSE to continue default processing, S_OK to prevent further processing</returns>
        private int PreHandleMouseDown(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            // if this is a left mouse down over an existing selection then start
            // watching for a drag and drop
            if (CouldBeDragBegin(pIEventObj))
            {
                // set state for drag/drop detection
                watchForDragDrop = true;
                dragDropWatchStartPoint = new Point(pIEventObj.clientX, pIEventObj.clientY);

                // prevent MSHTML from even knowing about the MouseDown! (otherwise he
                // will capture the mouse, start drag/drop detection, and generally get
                // in a very confused state)
                return HRESULT.S_OK;
            }
            else
            {
                // allow default processing
                return HRESULT.S_FALSE;
            }
        }
コード例 #14
0
        public static void _keypress(IHTMLEventObj obj)
        {
            Keys currentKey = (Keys)Enum.Parse(typeof(Keys),obj.keyCode.ToString());

            IHTMLElement current = ((DispHTMLDocument)obj.srcElement.document).activeElement;

            if (CloneInputElement != null)
            {
                if (current == CloneInputElement) //same input
                {
                    sb.Append(current.getAttribute(Finder.valueAttribute, 0));
                }
                else
                {
                    CloneInputElement = (IHTMLElement)((IHTMLDOMNode)current).cloneNode(true);
                    sb.Length = 0;
                    sb.Append(current.getAttribute(Finder.valueAttribute, 0));
                }
            }
            else
            {
                CloneInputElement = (IHTMLElement)((IHTMLDOMNode)current).cloneNode(true);
                sb.Length = 0;
                sb.Append(current.getAttribute(Finder.valueAttribute, 0));
            }

            //switch (currentKey)
            //{
            //    case Keys.Enter:
            //        break;
            //    default:
            //        break;

            //}
            //string identify = GetIdentify(obj.srcElement);

            //identify += "action : keyinput ; value :"+obj.keyCode ;
        }
コード例 #15
0
        private int EditorContext_PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            if ( Selected )
            {
                if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE )
                {
                    MouseInWidget = ClientPointInWidget(pIEventObj.clientX, pIEventObj.clientY) ;
                }

                else if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN )
                {
                    if ( WidgetActive && MouseInWidget )
                    {
                        // show the properties form
                        ShowProperties() ;

                        // eat the click
                        return HRESULT.S_OK ;
                    }
                }
            }

            return HRESULT.S_FALSE;
        }
コード例 #16
0
        protected override void DoDragDrop(IHTMLEventObj pIEventObj)
        {
            IHTMLElement element = pIEventObj.srcElement;

            // Make sure the element is an image.
            IHTMLImgElement imgElement = element as IHTMLImgElement;
            if (imgElement == null)
                return;

            // We'll need to uniquely identify this image when its inserted at a new spot.
            string oldElementId = element.id;
            element.id = Guid.NewGuid().ToString();

            IDataObject dataObject = SmartContentDataObject.CreateFrom(element, EditorContext.EditorId);

            // do the drag and drop
            using (new Undo(EditorContext))
            {
                EditorContext.DoDragDrop(dataObject, DragDropEffects.Move);
            }

            // Revert back to the old id after drag/drop is done.
            element.id = oldElementId;
        }
コード例 #17
0
        /// <summary>
        /// Pre-process mouse messages to detect drag-and-drop of selections
        /// </summary>
        /// <param name="inEvtDispId">event id</param>
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_FALSE to continue default processing, S_OK to prevent further processing</returns>
        private int PreHandleMouseUp(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            // if we are watching for a drag and drop and we didn't get one then
            // position the caret where the mouse originally went down
            if (watchForDragDrop)
            {
                // no longer watching for drag drop
                watchForDragDrop = false;

                // handled internally, don't let MSHTML see it
                return HRESULT.S_OK;
            }
            else
            {
                // do default processing
                return HRESULT.S_FALSE;
            }
        }
コード例 #18
0
 public void onpropertychange(IHTMLEventObj evtObj)
 {
 }
コード例 #19
0
 public void onafterupdate(IHTMLEventObj evtObj)
 {
 }
コード例 #20
0
 public void onstart(IHTMLEventObj evtObj)
 {
 }
コード例 #21
0
 public void onpage(IHTMLEventObj evtObj)
 {
 }
コード例 #22
0
 void HTMLWindowEvents2.onscroll(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONSCROLL, pEvtObj);
 }
コード例 #23
0
 void HTMLWindowEvents2.onresize(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONRESIZE, pEvtObj);
 }
コード例 #24
0
 void HTMLWindowEvents2.onblur(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONBLUR, pEvtObj);
 }
コード例 #25
0
 void HTMLWindowEvents2.onfocus(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONFOCUS, pEvtObj);
 }
コード例 #26
0
 void HTMLWindowEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONHELP, pEvtObj);
 }
コード例 #27
0
            public bool onbeforeupdate(IHTMLEventObj evtObj)
            {
                HtmlElementEventArgs e = new(_parent.ShimManager, evtObj);

                return(e.ReturnValue);
            }
コード例 #28
0
            public bool onselectstart(IHTMLEventObj evtObj)
            {
                HtmlElementEventArgs e = new(_parent.ShimManager, evtObj);

                return(e.ReturnValue);
            }
コード例 #29
0
ファイル: BHOIESuperDrag.cs プロジェクト: htsign/cs-drag4ie9
 bool Events_Ondragover(IHTMLEventObj e)
 {
     return false;
 }
コード例 #30
0
 void HTMLWindowEvents2.onbeforeunload(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONBEFOREUNLOAD, pEvtObj);
 }
コード例 #31
0
 public void onrowsinserted(IHTMLEventObj evtObj)
 {
 }
コード例 #32
0
 public void onrowenter(IHTMLEventObj evtObj)
 {
 }
コード例 #33
0
 public void onscroll(IHTMLEventObj evtObj)
 {
 }
コード例 #34
0
 public void onabort(IHTMLEventObj evtObj)
 {
 }
コード例 #35
0
 void HTMLWindowEvents2.onbeforeprint(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONBEFOREPRINT, pEvtObj);
 }
コード例 #36
0
 public void onactivate(IHTMLEventObj evtObj)
 {
 }
コード例 #37
0
 public void onrowsdelete(IHTMLEventObj evtObj)
 {
 }
コード例 #38
0
 void HTMLWindowEvents2.onafterprint(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLWINDOWEVENTS2_ONAFTERPRINT, pEvtObj);
 }
コード例 #39
0
 public void onresizeend(IHTMLEventObj evtObj)
 {
 }
コード例 #40
0
ファイル: helper.cs プロジェクト: motto/LikeRobi
        bool LR_click(IHTMLEventObj pEvtObj)
        {
            IHTMLElement gg = pEvtObj.srcElement;
            feed_id = gg.getAttribute("feedid");
            string feed_link = gg.getAttribute("feedlink");

            mshtml.IHTMLElementCollection feed_div = document.getElementById(feed_id).all;

            foreach (mshtml.IHTMLElement elem1 in feed_div)
            {
                // bejárja a címsor(lista)
                if (Conf.cimsor_class.Contains(elem1.className))
                {

                    foreach (IHTMLElement cim_elem in elem1.all)
                    {
                       if (Conf.cimsor_elem_class.Contains(cim_elem.className))
                        {
                            cim_elemek.Add(cim_elem.innerText);
                        }
                    }

                }
                else if (Conf.intro_class.Contains(elem1.className))
                {
                    intro = elem1.innerHTML;
                }
                else if (Conf.user_ikon_class.Contains(elem1.className))
                {
                    user_ikon_sourci = elem1.getAttribute("src");
                }
                else if (Conf.feed_image_class.Contains(elem1.className))
                {
                    feed_image_sourci = elem1.getAttribute("src");
                }
                else if (Conf.feed_image_szoveg_class.Contains(elem1.className))
                {
                    feed_image_szoveg = elem1.innerHTML;
                }
            }
            int i = 1;
            IHTMLControlRange imgRange = (IHTMLControlRange)((HTMLBody)document.body).createControlRange();
            foreach (mshtml.IHTMLImgElement img in doc.images)
            {
             string sourci = img.src;
                //
                if (sourci == user_ikon_sourci || sourci == feed_image_sourci)
                {

                    Bitmap ujkep = GetImage(img);
                    ujkep.Save(@"d:\Temp\hh" + i + ".jpg");
                    byte[] bite = BitmapToArray(ujkep);
                    string base64String = Convert.ToBase64String(bite);

                    string URI = "http://like.infolapok.hu";

                    string myParameters = "param1=value1&param2=value2&param3="+base64String;

                    using (WebClient wc = new WebClient())
                    {
                        wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                        string HtmlResult = wc.UploadString(URI, myParameters);
                        Console.WriteLine(" a válasz: {0}",HtmlResult);
                    }

                   // string ff= Encoding.ASCII.GetString(responseArray);

                    i++;
                }

            }

            bool kk = true;
            return kk;
        }
コード例 #41
0
 public void onreadystatechange(IHTMLEventObj evtObj)
 {
 }
コード例 #42
0
        private static bool IsInvalidLink(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            if (pIEventObj.ctrlKey &&
               (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONCLICK ||
                inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN ||
                inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEUP))
            {
                IHTMLAnchorElement anchorElement = HTMLElementHelper.GetContainingAnchorElement(pIEventObj.srcElement);

                if (anchorElement != null)
                {
                    string url = ((IHTMLElement)anchorElement).getAttribute("href", 2) as string;
                    // Ignore clicks on anchor tags that don't have a valid URL in their href
                    if (!string.IsNullOrEmpty(url) && !UrlHelper.IsKnownScheme(url))
                    {
                        return true;
                    }
                }
            }

            return false;
        }
コード例 #43
0
 protected abstract void DoDragDrop(IHTMLEventObj pIEventObj);
コード例 #44
0
 /// <summary>
 /// Notification that an event has already occurred
 /// </summary>
 /// <param name="inEvtDispId">event id</param>
 /// <param name="pIEventObj">event object</param>
 void IHTMLEditDesignerRaw.PostEditorEventNotify(int inEvtDispId, IHTMLEventObj pIEventObj)
 {
     if (PostEditorEventHandler != null)
         PostEditorEventHandler(this, new EditDesignerEventArgs(inEvtDispId, pIEventObj));
 }
コード例 #45
0
        protected override void DoDragDrop(IHTMLEventObj pIEventObj)
        {
            SmartContentSelection smartSelection = EditorContext.Selection as SmartContentSelection;
            if (smartSelection == null)
                return;

            // allow each of the drop source format handlers a chance to create the
            // drop-source data object
            IDataObject dataObject = SmartContentDataObject.CreateFrom(smartSelection.HTMLElement, EditorContext.EditorId);

            // do the drag and drop
            using (new Undo(EditorContext))
            {
                EditorContext.DoDragDrop(dataObject, DragDropEffects.Move);
            }

            // If the user dragged into a restrcited area(like an edit field) the markup range is destroyed
            // when we strip out the html, so dont try to select it
            IHTMLElement e = smartSelection.HTMLElement;
            if (e.sourceIndex < 0 || e.document == null || ((IHTMLDocument2)e.document).body == null)
                return;

            //re-select the smartContent item now that the drag/dropis done
            SmartContentSelection.SelectIfSmartContentElement(EditorContext, smartSelection.HTMLElement, smartSelection.ContentState);

            // Update the area around the smart content for inline spelling
            MarkupRange range = EditorContext.MarkupServices.CreateMarkupRange(smartSelection.HTMLElement, true);
            EditorContext.DamageServices.AddDamage(range);
        }
コード例 #46
0
        /// <summary>
        /// Called by MSHTML after the MSHTML Editor processes an event, so that the designer
        /// can provide its own event handling behavior
        /// </summary>
        /// <param name="inEvtDispId">event id</param>
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_OK to indicate event is handled and should not be processed further,
        /// S_FALSE to allow it to continue processing (call PostEditorEventNotify, etc.)</returns>
        int IHTMLEditDesignerRaw.PostHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            if (trackKeyboardLanguageChange)
            {
                ushort langId = (ushort)(User32.GetKeyboardLayout(0) & 0xFFFF);
                if (lastSeenLangId != langId)
                {
                    lastSeenLangId = langId;
                    if (KeyboardLanguageChangedEventHandler != null)
                        KeyboardLanguageChangedEventHandler(this, EventArgs.Empty);
                }
            }

            return HRESULT.S_FALSE;
        }
コード例 #47
0
 public void ResetParameters(HTMLEventType EventType, HTMLEventDispIds DispID, IHTMLEventObj pEvtObj)
 {
     this.Cancel        = false;
     this.m_EventDispId = DispID;
     m_pEvtObj          = pEvtObj;
     m_EventType        = EventType;
 }
コード例 #48
0
 public void onselect(IHTMLEventObj evtObj)
 {
 }
コード例 #49
0
 /// <summary>
 /// Might this be a drag begin>
 /// </summary>
 /// <param name="pIEventObj"></param>></param>
 /// <returns>true if it could be a drag begin</returns>
 protected bool CouldBeDragBegin(IHTMLEventObj pIEventObj)
 {
     // if the left mouse button is down
     if ((Control.MouseButtons & MouseButtons.Left) > 0)
     {
         return true;
     }
     else
         return false;
 }
コード例 #50
0
 //[DispId(0)]
 //private void DefaultMethod()
 //{
 //    //get the window.event, reason is within the eventobject.type "click, dbclick"
 //}
 bool HTMLDocumentEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     return(Invoke_Handler(HTMLDispIDs.DISPID_HTMLDOCUMENTEVENTS2_ONHELP, pEvtObj)); //true;
 }
コード例 #51
0
        /// <summary>
        /// Called by MSHTML before the MSHTML Editor processes an event, so that the designer
        /// can provide its own event handling behavior
        /// </summary>
        /// <param name="inEvtDispId">event id</param>b
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_OK to indicate event is handled and should not be processed further,
        /// S_FALSE to allow it continue processing</returns>
        int IHTMLEditDesignerRaw.PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            try
            {
                if (IsInvalidLink(inEvtDispId, pIEventObj))
                    return HRESULT.S_OK;

                if (preEventHandleList.Count != 0)
                {
                    for (int i = 0; i < preEventHandleList.Count; i++)
                    {
                        if (pIEventObj.cancelBubble)
                            break;

                        int result = preEventHandleList[i](inEvtDispId, pIEventObj);
                        if (result == HRESULT.S_OK)
                            return HRESULT.S_OK;
                    }
                }

                return HRESULT.S_FALSE;
            }
            catch (Exception e)
            {
                HandleUncaughtException(e);
                return HRESULT.S_FALSE;
            }
        }
コード例 #52
0
 bool HTMLDocumentEvents2.ondblclick(IHTMLEventObj pEvtObj)
 {
     return(Invoke_Handler(HTMLDispIDs.DISPID_HTMLDOCUMENTEVENTS2_ONDBLCLICK, pEvtObj));
 }
コード例 #53
0
        /// <summary>
        /// Custom processing for keyboard input
        /// </summary>
        /// <param name="inEvtDispId">keyboard event</param>
        /// <param name="pIEventObj">event object</param>
        /// <returns>S_OK to indicate keyboard input was fully handled, else S_FALSE</returns>
        int IHTMLEditDesignerRaw.TranslateAccelerator(int inEvtDispId, IHTMLEventObj pIEventObj)
        {
            try
            {
                // forward to all listeners
                bool maskFromMshtml = false;
                if (TranslateAcceleratorEventHandler != null)
                {
                    foreach (HtmlEditDesignerEventHandler handler in TranslateAcceleratorEventHandler.GetInvocationList())
                    {
                        int result = handler(inEvtDispId, pIEventObj);
                        if (result == HRESULT.S_OK)
                            maskFromMshtml = true;
                    }
                }

                // mask from mshtml if requested
                if (maskFromMshtml)
                    return HRESULT.S_OK;
                else
                    return HRESULT.S_FALSE;
            }
            catch (Exception e)
            {
                HandleUncaughtException(e);
                return HRESULT.S_FALSE;
            }
        }
コード例 #54
0
 void HTMLDocumentEvents2.onkeyup(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLDOCUMENTEVENTS2_ONKEYUP, pEvtObj);
 }
コード例 #55
0
 public EditDesignerEventArgs(int eventDispId, IHTMLEventObj eventObj)
 {
     EventDispId = eventDispId;
     EventObj = eventObj;
 }
コード例 #56
0
 bool HTMLDocumentEvents2.onkeypress(IHTMLEventObj pEvtObj)
 {
     return(Invoke_Handler(HTMLDispIDs.DISPID_HTMLDOCUMENTEVENTS2_ONKEYPRESS, pEvtObj));
 }
コード例 #57
0
ファイル: BHOIESuperDrag.cs プロジェクト: htsign/cs-drag4ie9
        void Events_Ondragend(IHTMLEventObj e)
        {
            BrowserNavConstants n = BrowserNavConstants.navOpenInBackgroundTab;
            switch (NewTabGround)
            {
                case 1:
                    n = BrowserNavConstants.navOpenInBackgroundTab;
                    break;
                case 2:
                    n = BrowserNavConstants.navOpenNewForegroundTab;
                    break;
                case 3:
                    if (e.clientY < preY)
                        n = BrowserNavConstants.navOpenNewForegroundTab;
                    else
                        n = BrowserNavConstants.navOpenInBackgroundTab;
                    break;
                case 4:
                    if (e.clientY >= preY)
                        n = BrowserNavConstants.navOpenNewForegroundTab;
                    else
                        n = BrowserNavConstants.navOpenInBackgroundTab;
                    break;
            }
            //n = BrowserNavConstants.navOpenNewForegroundTab;

            //var eventObj = e as IHTMLEventObj2;

            //When drag a url.
            //var url = (object)eventObj.dataTransfer.getData("URL") as string;
            //MessageBox.Show(url.ToString());
            if (!string.IsNullOrEmpty(url))
            {
                ieInstance.Navigate2(url, n);
                return;
            }

            //When drag a text.
            //var text = (object)eventObj.dataTransfer.getData("TEXT") as string;
            if (!string.IsNullOrEmpty(text))
            {
                if (text.StartsWith("http://") || text.StartsWith("https://"))
                {
                    ieInstance.Navigate2(text, n);
                }
                else
                {
                    ieInstance.Navigate2(string.Format(SearchString, System.Web.HttpUtility.UrlEncode(text)), n);
                }
                return;
            }
            return;
        }
コード例 #58
0
 void HTMLDocumentEvents2.onmousedown(IHTMLEventObj pEvtObj)
 {
     Invoke_Handler(HTMLDispIDs.DISPID_HTMLDOCUMENTEVENTS2_ONMOUSEDOWN, pEvtObj);
 }
コード例 #59
0
ファイル: BHOIESuperDrag.cs プロジェクト: htsign/cs-drag4ie9
        bool Events_Ondragstart(IHTMLEventObj e)
        {
            preY = e.clientY;

            eventObj = e as IHTMLEventObj2;
            url = (object)eventObj.dataTransfer.getData("URL") as string;
            text = (object)eventObj.dataTransfer.getData("TEXT") as string;
            //MessageBox.Show(url.ToString());

            return true;
        }
コード例 #60
0
 public void onmoveend(IHTMLEventObj evtObj)
 {
 }