示例#1
0
        bool CrashingTypeKey(char key, string state)
        {
            ParseModifier(state, out bool ctrl, out bool alt, out bool shift, out bool meta);

            var view = node.OwnerDocument.DefaultView;             //new FakeDomAbstractView ();//node.OwnerDocument.DefaultView;
            var ev   = new DomKeyboardEvent("keypress", true, true, view, "U+" + ((int)key).ToString("X4"), DomKeyLocation.Standard, ctrl, alt, shift, meta);

            return(node.DispatchEvent(ev));
        }
示例#2
0
    public static void RemoveEventListener <T>(string domEvent, Action <T> listener, bool useCapture = false)
    {
        var domEventType = DomEventArgs.TypeOf(domEvent);
        var listenerType = typeof(T);

        if (listenerType != domEventType)
        {
            throw new InvalidOperationException($"Invalid listner type ({listenerType}) for this dom event type ({domEventType})");
        }

        if (domEventType == typeof(DomKeyboardEventArgs))
        {
            var action = (listener as Action <DomKeyboardEventArgs>) !;
            var ids    = DomKeyboardEvent.RemoveListener(action, ElementName, useCapture ? TrueUseCapture : FalseUseCapture);
            BitButil.RemoveEventListener(ElementName, domEvent, ids, useCapture);
        }
    }