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="HashChangeEvent"/> event.</summary> /// <param name="e">The data for the event.</param> protected virtual void OnHashChange(DomHashChangeEventArgs e) { var evnt = (EventHandler<DomHashChangeEventArgs>)Events[HashChangeEvent]; if (evnt != null) evnt(this, e); }
/// <summary>Raises the <see cref="HashChangeEvent"/> event.</summary> /// <param name="e">The data for the event.</param> protected virtual void OnHashChange(DomHashChangeEventArgs e) { RaiseEvent(new RoutedEventArgs(HashChangeEvent, e)); }