private void ResumeProcessing(IResumeMessageRpc resume) { bool flag; resume.Resume(out flag); if (flag) { string message = System.ServiceModel.SR.GetString("SFxMultipleCallbackFromSynchronizationContext", new object[] { this.context.GetType().ToString() }); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(message)); } }
// static void OnFinalizeCorrelationCompletedCallback(IAsyncResult result) // { // if (result.CompletedSynchronously) // { // return; // } // IResumeMessageRpc resume = result.AsyncState as IResumeMessageRpc; // if (resume == null) // { // throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.Format(SR.SFxInvalidAsyncResultState0)); // } // resume.Resume(result); // } static void OnReplyCompletedCallback(Task result, object state) { IResumeMessageRpc resume = state as IResumeMessageRpc; if (resume == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.SFxInvalidAsyncResultState0); } resume.Resume(result); }
private void ResumeProcessing(IResumeMessageRpc resume) { bool alreadyResumedNoLock; resume.Resume(out alreadyResumedNoLock); if (alreadyResumedNoLock) { string text = SR.Format(SR.SFxMultipleCallbackFromSynchronizationContext, _context.GetType().ToString()); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(text)); } }
private static void OnReplyCompletedCallback(IAsyncResult result) { if (result.CompletedSynchronously) { return; } IResumeMessageRpc resume = result.AsyncState as IResumeMessageRpc; if (resume == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.SFxInvalidAsyncResultState0); } resume.Resume(result); }
void IWaiter.Signal() { try { bool alreadyResumedNoLock; resume.Resume(out alreadyResumedNoLock); if (alreadyResumedNoLock) { Fx.Assert("ConcurrencyBehavior resumed more than once for same call."); } } catch (Exception e) { if (Fx.IsFatal(e)) { throw; } throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); } }