コード例 #1
0
        public ZoneBinaryCallback registerBinaryCallback(Zone zone, ZoneBinaryCallback f)
        {
            var   implementation = _delegationTarget._registerBinaryCallback;
            _Zone implZone       = implementation.zone;
            RegisterBinaryCallbackHandler handler = implementation.function;

            return(handler(implZone, async_._parentDelegate(implZone), zone, f));
        }
コード例 #2
0
        public override object runBinary(ZoneBinaryCallback f, object arg1, object arg2)
        {
            var              implementation = _runBinary;
            ZoneDelegate     parentDelegate = async_._parentDelegate(implementation.zone);
            RunBinaryHandler handler        = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, f, arg1, arg2));
        }
コード例 #3
0
        public object runBinary(Zone zone, ZoneBinaryCallback f, object arg1, object arg2)
        {
            var              implementation = _delegationTarget._runBinary;
            _Zone            implZone       = implementation.zone;
            RunBinaryHandler handler        = implementation.function;

            return(handler(implZone, async_._parentDelegate(implZone), zone, f, arg1, arg2));
        }
コード例 #4
0
 public override object runBinary(ZoneBinaryCallback f, object arg1, object arg2)
 {
     if (ReferenceEquals(_current, async_._rootZone))
     {
         return(f(arg1, arg2));
     }
     return(async_._rootRunBinary(null, null, this, f, arg1, arg2));
 }
コード例 #5
0
        public override ZoneBinaryCallback registerBinaryCallback(ZoneBinaryCallback callback)
        {
            var          implementation           = _registerBinaryCallback;
            ZoneDelegate parentDelegate           = async_._parentDelegate(implementation.zone);
            RegisterBinaryCallbackHandler handler = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, callback));
        }
コード例 #6
0
 internal static object _invokeErrorHandler(
     ZoneBinaryCallback errorHandler, object error, string stackTrace)
 {
     // Dynamic invocation because we don't know the actual type of the
     // first argument or the error object, but we should successfully call
     // the handler if they match up.
     // TODO(lrn): Should we? Why not the same below for the unary case?
     return(errorHandler(error, stackTrace));
 }
コード例 #7
0
 public override object runBinaryGuarded(ZoneBinaryCallback f, object arg1, object arg2)
 {
     try {
         return(runBinary(f, arg1, arg2));
     }
     catch (Exception e) {
         handleUncaughtError(e);
         return(null);
     }
 }
コード例 #8
0
        public override object runBinaryGuarded(ZoneBinaryCallback f, object arg1, object arg2)
        {
            try {
                if (ReferenceEquals(async_._rootZone, _current))
                {
                    return(f(arg1, arg2));
                }

                return(async_._rootRunBinary(null, null, this, f, arg1, arg2));
            }
            catch (Exception e) {
                handleUncaughtError(e);
                return(null);
            }
        }
コード例 #9
0
 public override void onError(Action <object, string> handleError)
 {
     _source.onError(handleError);
     if (handleError == null)
     {
         _handleError = null;
     }
     else
     {
         _handleError = _zone
                        .registerBinaryCallback((a, b) => {
             handleError(a, (string)b);
             return(null);
         });
     }
 }
コード例 #10
0
        public override ZoneBinaryCallback bindBinaryCallbackGuarded(ZoneBinaryCallback f)
        {
            var registered = registerBinaryCallback(f);

            return((arg1, arg2) => runBinaryGuarded(registered, arg1, arg2));
        }
コード例 #11
0
 public abstract ZoneBinaryCallback bindBinaryCallbackGuarded(ZoneBinaryCallback callback);
コード例 #12
0
 public abstract ZoneBinaryCallback bindBinaryCallback(ZoneBinaryCallback callback);
コード例 #13
0
 public abstract object runBinaryGuarded(ZoneBinaryCallback action, object argument1, object argument2);
コード例 #14
0
 public override ZoneBinaryCallback registerBinaryCallback(ZoneBinaryCallback f) => f;
コード例 #15
0
 public override ZoneBinaryCallback bindBinaryCallbackGuarded(ZoneBinaryCallback f)
 {
     return((arg1, arg2) => runBinaryGuarded(f, arg1, arg2));
 }
コード例 #16
0
 Stream <T> handleError(ZoneBinaryCallback onError, _stream._ErrorTest test = null)
 {
     return(new _HandleErrorStream <T>(this, onError, test));
 }
コード例 #17
0
 public abstract ZoneBinaryCallback registerBinaryCallback(ZoneBinaryCallback fcallback);
コード例 #18
0
 internal _HandleErrorStream(Stream <T> source, ZoneBinaryCallback onError, _stream._ErrorTest test) :
     base(source)
 {
     _transform = onError;
     _test      = test;
 }