public int handleEvent(nsIDOMEvent _event)
        {
            _event.getType(storage);
            string       type = Base.StringGet(storage);
            string       key  = String.Intern(target.GetHashCode() + ":" + type);
            EventHandler eh   = Events[key] as EventHandler;

            if (eh != null)
            {
                eh(owner, new EventArgs());
                return(0);
            }
            Mono.WebBrowser.DOM.NodeEventHandler eh1 = Events[key] as Mono.WebBrowser.DOM.NodeEventHandler;
            if (eh1 != null)
            {
                eh1(owner, new Mono.WebBrowser.DOM.NodeEventArgs((Mono.WebBrowser.DOM.INode)owner));
                return(0);
            }

            Mono.WebBrowser.DOM.WindowEventHandler eh2 = Events[key] as Mono.WebBrowser.DOM.WindowEventHandler;
            if (eh2 != null)
            {
                eh2(owner, new Mono.WebBrowser.DOM.WindowEventArgs((Mono.WebBrowser.DOM.IWindow)owner));
                return(0);
            }

            return(0);
        }
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            if (e == null)
            {
                return;
            }

            OnHandleDomEvent(DomEventArgs.Create(e));
        }
        public void HandleEvent(nsIDOMEvent @event)
        {
            nsIDOMEventListener b = (nsIDOMEventListener)_browser;

            if (b != null)
            {
                b.HandleEvent(@event);
            }
        }
        public static DomEventArgs Create(nsIDOMEvent ev)
        {
            var type = nsString.Get(ev.GetTypeAttribute).ToLowerInvariant();

            // search by name and create child class wrappers
            switch (type)
            {
            case "keydown":
            case "keyup":
            case "keypress":
                return(DomKeyEventArgs.Create((nsIDOMKeyEvent)ev));

            case "mousedown":
            case "mouseup":
            case "mousemove":
            case "mouseover":
            case "mouseout":
            case "contextmenu":
                return(DomMouseEventArgs.Create((nsIDOMMouseEvent)ev));

            case "dommousescroll":
                return(DomMouseScrollEventArgs.Create((nsIDOMMouseScrollEvent)ev));

            case "dragstart":
            case "dragenter":
            case "dragover":
            case "dragleave":
            case "drag":
            case "drop":
            case "dragend":
                return(DomDragEventArgs.Create((nsIDOMDragEvent)ev));

            case "hashchange":
                return(DomHashChangeEventArgs.Create(( nsIDOMHashChangeEvent )ev));
            }
            // search by type
            if (ev is nsIDOMUIEvent)
            {
                return(DomUIEventArgs.Create((nsIDOMUIEvent)ev));
            }
            if (ev is nsIDOMMessageEvent)
            {
                return(DomMessageEventArgs.Create((nsIDOMMessageEvent)ev));
            }
            if (ev is nsIDOMSVGEvent)
            {
                return(DomSvgEvent.Create(( nsIDOMSVGEvent )ev));
            }
            return(new DomEventArgs(ev));
        }
 public static DomEventArgs Create(nsIDOMEvent ev)
 {
     var type = nsString.Get(ev.GetTypeAttribute).ToLowerInvariant();
     // search by name and create child class wrappers
     switch (type)
     {
         case "keydown":
         case "keyup":
         case "keypress":
             return DomKeyEventArgs.Create((nsIDOMKeyEvent)ev);
         case "mousedown":
         case "mouseup":
         case "mousemove":
         case "mouseover":
         case "mouseout":
         case "contextmenu":
             return DomMouseEventArgs.Create((nsIDOMMouseEvent)ev);
         case "dommousescroll":
             return DomMouseScrollEventArgs.Create((nsIDOMMouseScrollEvent)ev);
         case "dragstart":
         case "dragenter":
         case "dragover":
         case "dragleave":
         case "drag":
         case "drop":
         case "dragend":
             return DomDragEventArgs.Create((nsIDOMDragEvent)ev);
         case "hashchange":
             return DomHashChangeEventArgs.Create((nsIDOMHashChangeEvent)ev);
     }
     // search by type
     if (ev is nsIDOMUIEvent)
     {
         return DomUIEventArgs.Create((nsIDOMUIEvent)ev);
     }
     if (ev is nsIDOMMessageEvent)
     {
         return DomMessageEventArgs.Create((nsIDOMMessageEvent)ev);
     }
     if (ev is nsIDOMSVGEvent)
     {
         return DomSvgEvent.Create((nsIDOMSVGEvent)ev);
     }
     return new DomEventArgs(ev);
 }
示例#6
0
		internal static DomEvent Create(nsIDOMEvent domEvent)
		{
			if (domEvent == null)
			{
				return null;
			}

			if (domEvent is nsIDOMUIEvent)
			{
				return DomUIEvent.Create((nsIDOMUIEvent)domEvent);
			}

			if (domEvent is nsIDOMPopupBlockedEvent)
			{
				return DomPopupBlockedEvent.Create((nsIDOMPopupBlockedEvent)domEvent);
			}

			return new DomEvent(domEvent);
		}
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            nsAString jsEventName = new nsAString();
            nsAString attribute = new nsAString(JS_ELEMENT_NAME);
            nsAString value = new nsAString();

            nsIDOMElement target = e.GetTargetAttribute() as nsIDOMElement;

            target.GetAttribute(attribute, value);
            e.GetTypeAttribute(jsEventName);

            DOMJSONStringEventArgs eArgs = new DOMJSONStringEventArgs(jsEventName, value);
            if (this.handler != null)
                this.handler(target, eArgs);

            jsEventName.Dispose();
            attribute.Dispose();
            value.Dispose();
        }
示例#8
0
        public void OnShowContextMenu(UInt32 contextFlags,
                                      [MarshalAs(UnmanagedType.Interface)] nsIDOMEvent eve,
                                      [MarshalAs(UnmanagedType.Interface)] nsIDOMNode node)
        {
#if debug
            OnGeneric("OnShowContextMenu");
            Console.Error.WriteLine("OnShowContextMenu");
#endif
            ContextMenuEventHandler eh = (ContextMenuEventHandler)(owner.Events[WebBrowser.ContextMenuEvent]);

            if (eh != null)
            {
                nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent)eve;
                int x, y;
                mouseEvent.getClientX(out x);
                mouseEvent.getClientY(out y);
                ContextMenuEventArgs args = new ContextMenuEventArgs(x, y);
                eh(owner, args);
            }
        }
示例#9
0
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            nsAString jsEventName = new nsAString();
            nsAString attribute   = new nsAString(JS_ELEMENT_NAME);
            nsAString value       = new nsAString();

            nsIDOMElement target = e.GetTargetAttribute() as nsIDOMElement;

            target.GetAttribute(attribute, value);
            e.GetTypeAttribute(jsEventName);


            DOMJSONStringEventArgs eArgs = new DOMJSONStringEventArgs(jsEventName, value);

            if (this.handler != null)
            {
                this.handler(target, eArgs);
            }

            jsEventName.Dispose();
            attribute.Dispose();
            value.Dispose();
        }
示例#10
0
 public void BeginWindowMove(nsIDOMEvent mouseDownEvent)
 {
     this.CallVoidMethod("beginWindowMove", mouseDownEvent);
 }
示例#11
0
 public void BeginWindowMove(nsIDOMEvent mouseDownEvent, nsIDOMElement panel)
 {
     this.CallVoidMethod("beginWindowMove", mouseDownEvent, panel);
 }
示例#12
0
		void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
		{
			string type;
			using (nsAString str = new nsAString())
			{
				e.GetType(str);
				type = str.ToString();
			}
			
			switch (type)
			{
				case "keydown": OnDomKeyDown(new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e)); break;
				case "keyup": OnDomKeyUp(new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e)); break;
				
				case "mousedown": OnDomMouseDown(new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e)); break;
				case "mouseup": OnDomMouseUp(new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e)); break;
				case "mousemove": OnDomMouseMove(new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e)); break;
				case "mouseover": OnDomMouseOver(new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e)); break;
				case "mouseout": OnDomMouseOut(new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e)); break;
				
				case "submit":
					//TEMP: disable this because it's causing crashes
					//MessageBox.Show("Form submission has been disabled to improve stability in this version.", "Gecko", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					
					//e.PreventDefault();
					//e.StopPropagation();
					break;
			}
		}
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            string type;
            using (nsAString str = new nsAString())
            {
                e.GetTypeAttribute(str);
                type = str.ToString();
            }

            GeckoDomEventArgs ea = null;

            switch (type)
            {
                case "keydown": OnDomKeyDown((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
                case "keyup": OnDomKeyUp((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
                case "keypress": OnDomKeyPress((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;

                case "mousedown": OnDomMouseDown((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseup": OnDomMouseUp((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mousemove": OnDomMouseMove((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseover": OnDomMouseOver((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseout": OnDomMouseOut((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "click": OnDomClick(ea = new GeckoDomEventArgs(e)); break;
                case "submit": OnDomSubmit(ea = new GeckoDomEventArgs(e)); break;
                case "compositionstart": OnDomCompositionStart(ea = new GeckoDomEventArgs(e)); break;
                case "compositionend": OnDomCompositionEnd(ea = new GeckoDomEventArgs(e)); break;
                case "contextmenu": OnDomContextMenu((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "DOMMouseScroll": OnDomMouseScroll((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "focus": OnDomFocus(ea = new GeckoDomEventArgs(e)); break;
            }

            if (ea != null && ea.Cancelable && ea.Handled)
                e.PreventDefault();
        }
示例#14
0
 public void OpenPopup(nsIDOMElement anchorElement, string position, int x, int y, bool isContextMenu, bool attributesOverride, nsIDOMEvent triggerEvent)
 {
     this.CallVoidMethod("openPopup", anchorElement, position, x, y, isContextMenu, attributesOverride, triggerEvent);
 }
示例#15
0
 public void HandleEvent(nsIDOMEvent @event)
 {
     this.CallVoidMethod("handleEvent", @event);
 }
        public void HandleEvent(nsIDOMEvent @event)
        {
            // This is how to get the fields, but we don't need them by default since sometimes they are undefined
            //var xhr_uri = (new Uri(nsString.Get(m_httpChannel.GetOriginalURIAttribute().GetSpecAttribute))).ToString();
            //var xhr_status = m_notificationCallsbacks.GetStatusAttribute();
            var xhr_readyState = m_notificationCallsbacks.GetReadyStateAttribute();

            bool bHandlerFailed = false;

            try
            {
                m_origEventListener.HandleEvent(@event);
            }
            catch (Exception)
            {
                bHandlerFailed = true;
            }

            // remove when finished
            if (bHandlerFailed || (xhr_readyState == 4))
            {
                m_browser.origJavaScriptHttpChannels.Remove(m_httpChannel);
            }
        }
示例#17
0
 protected DomEventArgs(nsIDOMEvent ev)
 {
     _event = ev;
 }
示例#18
0
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            string type;
            using (nsAString str = new nsAString())
            {
                e.GetTypeAttribute(str);
                type = str.ToString();
            }

            GeckoDomEventArgs ea = null;

            switch (type)
            {
                case "keydown": OnDomKeyDown((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
                case "keyup": OnDomKeyUp((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
                case "keypress": OnDomKeyPress((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;

                case "mousedown": OnDomMouseDown((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseup": OnDomMouseUp((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mousemove": OnDomMouseMove((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseover": OnDomMouseOver((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseout": OnDomMouseOut((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "click": OnDomClick(ea = new GeckoDomEventArgs(e)); break;
                case "dblclick": OnDomDoubleClick(ea = new GeckoDomEventArgs(e)); break;
                case "submit": OnDomSubmit(ea = new GeckoDomEventArgs(e)); break;
                case "compositionstart": OnDomCompositionStart(ea = new GeckoDomEventArgs(e)); break;
                case "compositionend": OnDomCompositionEnd(ea = new GeckoDomEventArgs(e)); break;
                case "contextmenu": OnDomContextMenu((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "DOMMouseScroll": OnDomMouseScroll((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "focus": OnDomFocus(ea = new GeckoDomEventArgs(e)); break;
                case "load": OnLoad(ea = new GeckoDomEventArgs(e)); break;
                case "change": OnDomContentChanged(ea = new GeckoDomEventArgs(e)); break;

                default:
                    Action<string> action;
                    if(_messageEventListeners.TryGetValue(type, out action))
                    {

                        action.Invoke(new GeckoDomMessageEventArgs((nsIDOMMessageEvent)e).Message);
                    }
                    break;
            }

            if (ea != null && ea.Cancelable && ea.Handled)
                e.PreventDefault();
        }
 public void HandleEvent(nsIDOMEvent @event)
 {
     nsIDOMEventListener b = (nsIDOMEventListener)_browser;
     if (b != null)
         b.HandleEvent(@event);
 }
示例#20
0
		void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
		{
			if (e == null) return;

			OnHandleDomEvent(DomEventArgs.Create(e));
		}
示例#21
0
 public void OpenPopupAtScreenRect(string position, int x, int y, int width, int height, bool isContextMenu, bool attributesOverride, nsIDOMEvent triggerEvent)
 {
     this.CallVoidMethod("openPopupAtScreenRect", position, x, y, width, height, isContextMenu, attributesOverride, triggerEvent);
 }
示例#22
0
 public void OpenPopupAtScreen(int x, int y, bool isContextMenu, nsIDOMEvent triggerEvent)
 {
     this.CallVoidMethod("openPopupAtScreen", x, y, isContextMenu, triggerEvent);
 }
示例#23
0
		public static nsIDOMEvent GetProxy (Mono.WebBrowser.IWebBrowser control, nsIDOMEvent obj)
		{
			object o = Base.GetProxyForObject (control, typeof(nsIDOMEvent).GUID, obj);
			return o as nsIDOMEvent;
		}
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            string type;
            using (nsAString str = new nsAString())
            {
                e.GetType(str);
                type = str.ToString();
            }

            GeckoDomEventArgs ea = null;

            switch (type)
            {
                case "keydown": OnDomKeyDown((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
                case "keyup": OnDomKeyUp((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;

                case "mousedown": OnDomMouseDown((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseup": OnDomMouseUp((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mousemove": OnDomMouseMove((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseover": OnDomMouseOver((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "mouseout": OnDomMouseOut((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
                case "click": OnDomClick(ea = new GeckoDomEventArgs(e)); break;
                case "submit": OnDomSubmit(ea = new GeckoDomEventArgs(e)); break;
            }

            if (ea != null && ea.Cancelable && ea.Handled)
                e.PreventDefault();
        }
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            //string type = nsString.Get(e.GetTypeAttribute);

            //GeckoDomEventArgs ea = null;

            //switch (type)
            //{
            //    case "keydown": OnDomKeyDown((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
            //    case "keyup": OnDomKeyUp((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;
            //    case "keypress": OnDomKeyPress((GeckoDomKeyEventArgs)(ea = new GeckoDomKeyEventArgs((nsIDOMKeyEvent)e))); break;

            //    case "mousedown": OnDomMouseDown((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "mouseup": OnDomMouseUp((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "mousemove": OnDomMouseMove((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "mouseover": OnDomMouseOver((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "mouseout": OnDomMouseOut((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "click": OnDomClick(ea = new GeckoDomEventArgs(e)); break;
            //    case "dblclick": OnDomDoubleClick(ea = new GeckoDomEventArgs(e)); break;
            //    case "submit": OnDomSubmit(ea = new GeckoDomEventArgs(e)); break;
            //    case "compositionstart": OnDomCompositionStart(ea = new GeckoDomEventArgs(e)); break;
            //    case "compositionend": OnDomCompositionEnd(ea = new GeckoDomEventArgs(e)); break;
            //    case "contextmenu": OnDomContextMenu((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "DOMMouseScroll": OnDomMouseScroll((GeckoDomMouseEventArgs)(ea = new GeckoDomMouseEventArgs((nsIDOMMouseEvent)e))); break;
            //    case "focus": OnDomFocus(ea = new GeckoDomEventArgs(e)); break;
            //    case "blur": OnDomBlur(ea = new GeckoDomEventArgs(e)); break;
            //    case "load": OnLoad(ea = new GeckoDomEventArgs(e)); break;
            //    case "change": OnDomContentChanged(ea = new GeckoDomEventArgs(e)); break;
            //    case "hashchange": OnHashChange(ea = new GeckoDomEventArgs(e)); break;

            //    default:
            //        Action<string> action;
            //        if (_messageEventListeners.TryGetValue(type, out action))
            //        {

            //            action.Invoke(new GeckoDomMessageEventArgs((nsIDOMMessageEvent)e).Message);
            //        }
            //        break;
            //}

            //if (ea != null && ea.Cancelable && ea.Handled)
            //    e.PreventDefault();
        }
        void nsIDOMEventListener.HandleEvent(nsIDOMEvent e)
        {
            if (e == null) return;

            string type = nsString.Get(e.GetTypeAttribute);

            DomEventArgs ea = DomEventArgs.Create(e);

            switch (type)
            {
                case "keydown":
                    OnDomKeyDown((DomKeyEventArgs)ea);
                    break;
                case "keyup":
                    OnDomKeyUp((DomKeyEventArgs)ea);
                    break;
                case "keypress":
                    OnDomKeyPress((DomKeyEventArgs)ea);
                    break;
                case "mousedown":
                    OnDomMouseDown((DomMouseEventArgs)ea);
                    break;
                case "mouseup":
                    OnDomMouseUp((DomMouseEventArgs)ea);
                    break;
                case "mousemove":
                    OnDomMouseMove((DomMouseEventArgs)ea);
                    break;
                case "mouseover":
                    OnDomMouseOver((DomMouseEventArgs)ea);
                    break;
                case "mouseout":
                    OnDomMouseOut((DomMouseEventArgs)ea);
                    break;
                case "click":
                    OnDomClick(ea);
                    break;
                case "dblclick":
                    OnDomDoubleClick(ea);
                    break;
                case "submit":
                    OnDomSubmit(ea);
                    break;
                case "compositionstart":
                    OnDomCompositionStart(ea);
                    break;
                case "compositionend":
                    OnDomCompositionEnd(ea);
                    break;
                case "contextmenu":
                    OnDomContextMenu((DomMouseEventArgs)ea);
                    break;
                case "DOMMouseScroll":
                    OnDomMouseScroll((DomMouseEventArgs)ea);
                    break;
                case "focus":
                    OnDomFocus(ea);
                    break;
                case "blur":
                    OnDomBlur(ea);
                    break;
                case "load":
                    OnLoad(ea);
                    break;
                case "DOMContentLoaded":
                    OnDOMContentLoaded(ea);
                    break;
                case "readystatechange":
                    OnReadyStateChange(ea);
                    break;
                case "change":
                    OnDomContentChanged(ea);
                    break;
                case "hashchange":
                    OnHashChange((DomHashChangeEventArgs)ea);
                    break;
                case "dragstart":
                    OnDomDragStart((DomDragEventArgs)ea);
                    break;
                case "dragenter":
                    OnDomDragEnter((DomDragEventArgs)ea);
                    break;
                case "dragover":
                    OnDomDragOver((DomDragEventArgs)ea);
                    break;
                case "dragleave":
                    OnDomDragLeave((DomDragEventArgs)ea);
                    break;
                case "drag":
                    OnDomDrag((DomDragEventArgs)ea);
                    break;
                case "drop":
                    OnDomDrop((DomDragEventArgs)ea);
                    break;
                case "dragend":
                    OnDomDragEnd((DomDragEventArgs)ea);
                    break;
            }
            if (ea is DomMessageEventArgs)
            {
                Action<string> action;
                DomMessageEventArgs mea = (DomMessageEventArgs)ea;
                if (_messageEventListeners.TryGetValue(type, out action))
                {
                    action.Invoke(mea.Message);
                }
            }

            if (ea != null && ea.Cancelable && ea.Handled)
                e.PreventDefault();

        }
		void nsIContextMenuListener.OnShowContextMenu(UInt32 aContextFlags, nsIDOMEvent aEvent, nsIDOMNode aNode)
		{
			var e = new ContextMenuEventArgs((ContextMenuContext)aContextFlags, aEvent, aNode);
			Events.Raise(EventKey.ShowContextMenu, e);
		}
示例#28
0
        public static nsIDOMEvent GetProxy(Mono.WebBrowser.IWebBrowser control, nsIDOMEvent obj)
        {
            object o = Base.GetProxyForObject(control, typeof(nsIDOMEvent).GUID, obj);

            return(o as nsIDOMEvent);
        }
示例#29
0
 public bool DispatchEvent(nsIDOMEvent @event)
 {
     return(this.CallMethod <bool>("dispatchEvent", @event));
 }
示例#30
0
 internal GeckoDomEventArgs(nsIDOMEvent ev)
 {
     _Event = ev;
 }
示例#31
0
		public int handleEvent (nsIDOMEvent _event) 
		{
			_event.getType (storage);
			string type = Base.StringGet (storage);
			string key = String.Intern (target.GetHashCode () + ":" + type);
			EventHandler eh = Events[key] as EventHandler;
			if (eh != null) {
				eh (owner, new EventArgs ());
				return 0;
			}
			Mono.WebBrowser.DOM.NodeEventHandler eh1 = Events[key] as Mono.WebBrowser.DOM.NodeEventHandler;
			if (eh1 != null) {
				eh1 (owner, new Mono.WebBrowser.DOM.NodeEventArgs ((Mono.WebBrowser.DOM.INode)owner));
				return 0;
			}

			Mono.WebBrowser.DOM.WindowEventHandler eh2 = Events[key] as Mono.WebBrowser.DOM.WindowEventHandler;
			if (eh2 != null) {
				eh2 (owner, new Mono.WebBrowser.DOM.WindowEventArgs ((Mono.WebBrowser.DOM.IWindow)owner));
				return 0;
			}
			
			return 0;
		}
示例#32
0
		internal DomEvent(nsIDOMEvent domEvent)
		{
			Debug.Assert(domEvent != null);
			m_DomEvent = domEvent;
		}
示例#33
0
 public void InitCommandEvent(string type, bool canBubble, bool cancelable, nsIDOMWindow view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, nsIDOMEvent sourceEvent)
 {
     this.CallVoidMethod("initCommandEvent", type, canBubble, cancelable, view, detail, ctrlKey, altKey, shiftKey, metaKey, sourceEvent);
 }
 protected DomEventArgs(nsIDOMEvent ev)
 {
     _event = ev;
 }
 internal GeckoDomEventArgs(nsIDOMEvent ev)
 {
     _Event = ev;
 }
		internal ContextMenuEventArgs(ContextMenuContext context, nsIDOMEvent domEvent, nsIDOMNode domNode)
		{
			m_Context = context;
			m_DomEvent = DomEvent.Create(domEvent);
			m_DomNode = DomNode.Create(domNode);
		}