Esempio n. 1
0
        public void resolve(PointerSignalEvent evt)
        {
            if (this._firstRegisteredCallback == null)
            {
                D.assert(this._currentEvent == null);
                return;
            }

            D.assert(this._currentEvent == evt);
            try {
                this._firstRegisteredCallback(evt);
            }
            catch (Exception exception) {
                UIWidgetsError.reportError(new UIWidgetsErrorDetails(
                                               exception: exception,
                                               library: "gesture library",
                                               context: "while resolving a PointerSignalEvent",
                                               informationCollector: information => {
                    information.AppendLine("Event: ");
                    information.AppendFormat(" {0}", evt);
                }
                                               )
                                           );
            }

            this._firstRegisteredCallback = null;
            this._currentEvent            = null;
        }
Esempio n. 2
0
        public void resolve(PointerSignalEvent evt)
        {
            if (_firstRegisteredCallback == null)
            {
                D.assert(_currentEvent == null);
                return;
            }

            D.assert(_isSameEvent(_currentEvent, evt));
            try {
                _firstRegisteredCallback(_currentEvent);
            }
            catch (Exception exception) {
                IEnumerable <DiagnosticsNode> infoCollector()
                {
                    yield return(new DiagnosticsProperty <PointerSignalEvent>("Event", evt, style: DiagnosticsTreeStyle.errorProperty));
                }

                UIWidgetsError.reportError(new UIWidgetsErrorDetails(
                                               exception: exception,
                                               library: "gesture library",
                                               context: new ErrorDescription("while resolving a PointerSignalEvent"),
                                               informationCollector: infoCollector
                                               )
                                           );
            }

            _firstRegisteredCallback = null;
            _currentEvent            = null;
        }
Esempio n. 3
0
        public void register(PointerSignalEvent evt, PointerSignalResolvedCallback callback)
        {
            D.assert(evt != null);
            D.assert(callback != null);
            D.assert(this._currentEvent == null || this._currentEvent == evt);
            if (this._firstRegisteredCallback != null)
            {
                return;
            }

            this._currentEvent            = evt;
            this._firstRegisteredCallback = callback;
        }
Esempio n. 4
0
        public void register(PointerSignalEvent evt, PointerSignalResolvedCallback callback)
        {
            D.assert(evt != null);
            D.assert(callback != null);
            D.assert(_currentEvent == null || _isSameEvent(_currentEvent, evt));
            if (_firstRegisteredCallback != null)
            {
                return;
            }

            _currentEvent            = evt;
            _firstRegisteredCallback = callback;
        }
Esempio n. 5
0
 public bool _isSameEvent(PointerSignalEvent event1, PointerSignalEvent event2)
 {
     return((event1.original ?? event1) == (event2.original ?? event2));
 }