public static DomMouseEventArgs Create(nsIDOMMouseEvent ev)
 {
     if (ev is nsIDOMMouseScrollEvent)
     {
         return(DomMouseScrollEventArgs.Create((nsIDOMMouseScrollEvent)ev));
     }
     if (ev is nsIDOMDragEvent)
     {
         return(DomDragEventArgs.Create((nsIDOMDragEvent)ev));
     }
     return(new DomMouseEventArgs(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));
        }
 /// <summary>Raises the <see cref="DomDragEnd"/> event.</summary>
 /// <param name="e">The data for the event.</param>
 protected virtual void OnDomDragEnd(DomDragEventArgs e)
 {
     RaiseEvent(new RoutedEventArgs(DomDragEndEvent, e));
 }
		/// <summary>Raises the <see cref="DomDragStart"/> event.</summary>
		/// <param name="e">The data for the event.</param>
		protected virtual void OnDomDragStart(DomDragEventArgs e)
		{
			var evnt = (EventHandler<DomDragEventArgs>)Events[DomDragStartEvent];
			if (evnt != null) evnt(this, e);
		}
 /// <summary>Raises the <see cref="DomDrop"/> event.</summary>
 /// <param name="e">The data for the event.</param>
 protected virtual void OnDomDrop(DomDragEventArgs e)
 {
     var evnt = (EventHandler<DomDragEventArgs>)_eventList[DomDropEvent];
     if (evnt != null) evnt(this, e);
 }