Example #1
0
        /// <summary>
        ///		Creates an instance of <see cref="AsyncYieldInstruction{TSelf}"/>
        /// </summary>
        /// <param name="self">The object which performs the pattern</param>
        /// <param name="begin">The method to begin the pattern</param>
        /// <param name="end">The method to end the void pattern</param>
        public AsyncYieldInstruction(TSelf self, BeginAsync <TSelf> begin, EndAsync <TSelf> end)
        {
            _self = self;
            _end  = end;

            _async = begin(_self, Callback, this);
        }
Example #2
0
 /// <summary>
 ///		Creates a super yield instruction which executes this instruction, then executes an async pattern, and finally returns the result of this instruction
 /// </summary>
 /// <param name="begin">The method to begin the async operation</param>
 /// <param name="end">The method to end the void async operation</param>
 public ResultYieldInstruction <TResult> ContinueWith(BeginAsync <TResult> begin, EndAsync <TResult> end)
 {
     return(ContinueWith(result => new AsyncYieldInstruction <TResult>(result, begin, end)));
 }