public static void RunWithTimeout(Func<AsyncCallback, object, IAsyncResult> beginMethod, AsyncCallback callback, TimerCallback timeoutCallback, object state, TimeSpan timeout)
        {
            CommonUtility.AssertNotNull("beginMethod", beginMethod);
            CommonUtility.AssertNotNull("callback", callback);
            CommonUtility.AssertNotNull("timeoutCallback", timeoutCallback);

            APMWithTimeout operation = new APMWithTimeout(timeoutCallback);
            operation.Begin(beginMethod, callback, state, timeout);
        }
Beispiel #2
0
        public static void RunWithTimeout(Func <AsyncCallback, object, IAsyncResult> beginMethod, AsyncCallback callback, TimerCallback timeoutCallback, object state, TimeSpan timeout)
        {
            CommonUtility.AssertNotNull("beginMethod", beginMethod);
            CommonUtility.AssertNotNull("callback", callback);
            CommonUtility.AssertNotNull("timeoutCallback", timeoutCallback);

            APMWithTimeout operation = new APMWithTimeout(timeoutCallback);

            operation.Begin(beginMethod, callback, state, timeout);
        }