static bool HandleEndSuspend(IAsyncResult result)
            {
                SuspendAsyncResult thisPtr = (SuspendAsyncResult)result.AsyncState;

                if (thisPtr.isTransacted)
                {
                    thisPtr.channel.EndTransactedSuspend(result);
                }
                else
                {
                    thisPtr.channel.EndSuspend(result);
                }
                return(true);
            }
                public SuspendCoreAsyncResult(SuspendAsyncResult parent, AsyncCallback callback, object state)
                    : base(callback, state)
                {
                    this.parent = parent;

                    IAsyncResult result = this.parent.Instance.BeginWaitForCanPersist(ref this.parent.ownsLock, this.parent.timeoutHelper.RemainingTime(),
                        PrepareAsyncCompletion(handleEndWaitForCanPersist), this);
                    if (SyncContinue(result))
                    {
                        this.Complete(true);
                    }
                }
 public static SuspendAsyncResult Create(WorkflowServiceInstance instance, bool isUnlocked, string reason, Transaction transaction, TimeSpan timeout, AsyncCallback callback, object state)
 {
     SuspendAsyncResult result = new SuspendAsyncResult(instance, isUnlocked, reason, transaction, callback, state);
     result.Run(timeout);
     return result;
 }
 public void EndSuspend(IAsyncResult result)
 {
     SuspendAsyncResult.End(result);
 }