BEHelper.AsyncContext.AsyncPost C# (CSharp) Method

AsyncPost() public method

Post a call to the specified method on the creator thread
public AsyncPost ( SendOrPostCallback callback, object state ) : void
callback SendOrPostCallback Method that is to be called
state object Method parameter/state
return void
        public void AsyncPost(SendOrPostCallback callback, object state)
        {
            if (IsAsyncCreatorThread)
                callback(state); // Call the method directly
            else
                AsynchronizationContext.Post(callback, state);  // Post on creator thread
        }
    }

Usage Example

Beispiel #1
0
 public void AsyncPost(SendOrPostCallback callback, object state)
 {
     _asyncContext.AsyncPost(callback, state);
 }