예제 #1
0
            protected void EventHandler(IEventInfo e)
            {
                if (_IsCompleted)
                {
                    return;
                }

                // Events that don't match are silently rejected.
                // FIXME: Is this actually horrible
                if (!TryExtractResult(e, out Result))
                {
                    return;
                }

                e.Consume();
                _IsCompleted = true;
                Dispose();

                if (Continuation != null)
                {
                    Continuation();
                }

                if (_Future != null)
                {
                    _Future.SetResult(Result, null);
                }
            }
예제 #2
0
 protected abstract bool TryExtractResult(IEventInfo e, out T result);