• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IHTMLEventObj类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IHTMLEventObj的典型用法代码示例。如果您正苦于以下问题:C# IHTMLEventObj类的具体用法?C# IHTMLEventObj怎么用?C# IHTMLEventObj使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IHTMLEventObj类属于命名空间,在下文中一共展示了IHTMLEventObj类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ResetParameters

 public void ResetParameters(HTMLEventType EventType, HTMLEventDispIds DispID, IHTMLEventObj pEvtObj)
 {
     this.Cancel = false;
     this.m_EventDispId = DispID;
     m_pEvtObj = pEvtObj;
     m_EventType = EventType;
 }
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:7,代码来源:HTMLEvents.cs


示例2: PreHandleEvent

        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;
        }
开发者ID:artmachinez,项目名称:bc,代码行数:28,代码来源:CRestrictedEditDesigner.cs


示例3: _editorContext_PreHandleEvent

        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;
            }
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:27,代码来源:TableColumnSizeEditor.cs


示例4: _click

 ///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();
 }
开发者ID:krishnakanthms,项目名称:recordanywhere,代码行数:13,代码来源:DOMEventMethods.cs


示例5: HandleMouseEvent

        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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:59,代码来源:TableColumnSizeEditor.cs


示例6: HTMLDocumentEventArgs

 bool HTMLDocumentEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (doconhelp != null)
     {
         HTMLDocumentEventArgs arg = new HTMLDocumentEventArgs(pEvtObj);
         doconhelp(this, arg);
         return arg.AllowDefault;
     }
     else
         return true; //Allow, default
 }
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:11,代码来源:HTMLDocumentEvents.cs


示例7: HTMLSelectElementEventArgs

 bool HTMLSelectElementEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (selectonhelp != null)
     {
         HTMLSelectElementEventArgs args = new HTMLSelectElementEventArgs(pEvtObj);
         selectonhelp(this, args);
         return args.AllowDefault;
     }
     else
         return true; //Allow, default
 }
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:11,代码来源:HTMLSelectElementEvents.cs


示例8: HTMLScriptEventArgs

 bool HTMLScriptEvents2.onhelp(IHTMLEventObj pEvtObj)
 {
     if (scriptonhelp != null)
     {
         HTMLScriptEventArgs arg = new HTMLScriptEventArgs(pEvtObj);
         scriptonhelp(this, arg);
         return arg.AllowDefault;
     }
     else
         return true;
 }
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:11,代码来源:HTMLScriptEvents.cs


示例9: PreHandleEvent

        /// <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;
            }
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:23,代码来源:BehaviorDragDropSource.cs


示例10: HandlePreHandleEvent

        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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:17,代码来源:DisabledImageElementBehavior.cs


示例11: ProcessEvent

        /// <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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:51,代码来源:RtlAcceleratorTranslator.cs


示例12: _click

        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;
            }
        }
开发者ID:krishnakanthms,项目名称:recordanywhere,代码行数:18,代码来源:Plugin.cs


示例13: PreHandleMouseDown

        // <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;
            }
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:27,代码来源:BehaviorDragDropSource.cs


示例14: _keypress

        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 ;
        }
开发者ID:krishnakanthms,项目名称:recordanywhere,代码行数:38,代码来源:DOMEventMethods.cs


示例15: EditorContext_PreHandleEvent

        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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:24,代码来源:PropertiesEditingElementBehavior.cs


示例16: CouldBeDragBegin

 /// <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;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:15,代码来源:BehaviorDragDropSource.cs


示例17: DoDragDrop

        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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:24,代码来源:BehaviorDragDropSource.cs


示例18: IsInvalidLink

        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;
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:22,代码来源:MshtmlEditor.cs


示例19: PostEditorEventHandler

 /// <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));
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:10,代码来源:MshtmlEditor.cs


示例20: LR_click

        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;
        }
开发者ID:motto,项目名称:LikeRobi,代码行数:75,代码来源:helper.cs



注:本文中的IHTMLEventObj类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IHTMLItem类代码示例发布时间:2022-05-24
下一篇:
C# IHTMLElement类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap