protected override sealed InvokeCompletedResult EndInvokeCore(IAsyncResult asyncResult) { FakeInvokeAsyncResult localAsyncResult = (FakeInvokeAsyncResult)asyncResult; InvokeCompletedResult result = new InvokeCompletedResult(localAsyncResult.Result); return(result); }
protected override sealed IAsyncResult BeginInvokeCore(InvokeArgs invokeArgs, AsyncCallback callback, object userState) { object result = Invoke(invokeArgs); FakeInvokeAsyncResult asyncResult = new FakeInvokeAsyncResult { Callback = callback, AsyncState = userState, Result = result }; this.syncContext.Post(cb => ((FakeAsyncResult)cb).Complete(), asyncResult); return(asyncResult); }