Пример #1
0
        /// <summary>
        /// Complete the promise. Adds a defualt error handler.
        /// </summary>
        public void Done()
        {
            var resultPromise = new Promise();

            resultPromise.WithName(Name);

            ActionHandlers(resultPromise,
                           () => { },
                           ex => Promise.PropagateUnhandledException(this, ex)
                           );
        }
Пример #2
0
        /// <summary>
        /// Completes the promise.
        /// onResolved is called on successful completion.
        /// Adds a default error handler.
        /// </summary>
        public void Done(Action onResolved)
        {
            Argument.NotNull(() => onResolved);

            var resultPromise = new Promise();

            resultPromise.WithName(Name);

            ActionHandlers(resultPromise,
                           onResolved,
                           ex => Promise.PropagateUnhandledException(this, ex)
                           );
        }