Ejemplo n.º 1
0
        public static IAsyncResult Begin <TState>(AsyncCallback callback, object callbackState, BeginInvokeDelegate <TState> beginDelegate, EndInvokeVoidDelegate <TState> endDelegate, TState invokeState, object tag = null, int timeout = Timeout.Infinite, SynchronizationContext callbackSyncContext = null)
        {
            WrappedAsyncVoid <TState> asyncResult = new WrappedAsyncVoid <TState>(beginDelegate, endDelegate, invokeState, tag, callbackSyncContext);

            asyncResult.Begin(callback, callbackState, timeout);
            return(asyncResult);
        }
Ejemplo n.º 2
0
        public static IAsyncResult Begin <TState>(AsyncCallback callback, object callbackState, Func <AsyncCallback, object, TState, IAsyncResult> beginDelegate, Action <IAsyncResult, TState> endDelegate, TState invokeState, object tag = null, int timeout = -1, SynchronizationContext callbackSyncContext = null)
        {
            WrappedAsyncVoid <TState> wrappedAsyncVoid = new WrappedAsyncVoid <TState>(beginDelegate, endDelegate, invokeState, tag, callbackSyncContext);

            wrappedAsyncVoid.Begin(callback, callbackState, timeout);
            return(wrappedAsyncVoid);
        }