public ControlOperationAsyncResult(ControlOperationInvoker invoker, object[] inputs, IInvokeReceivedNotification notification, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                this.instanceKey      = InstanceKey.InvalidKey;
                this.additionalKeys   = emptyKeyCollection;
                this.outputs          = ControlOperationInvoker.emptyObjectArray;
                this.invoker          = invoker;
                this.inputs           = inputs;
                this.timeoutHelper    = new TimeoutHelper(timeout);
                this.transaction      = Transaction.Current;
                this.operationContext = OperationContext.Current;
                base.OnCompleting     = onCompleting;
                bool flag  = false;
                bool flag2 = false;

                try
                {
                    if (notification != null)
                    {
                        if (this.operationContext.SessionId == null)
                        {
                            notification.NotifyInvokeReceived();
                        }
                        else
                        {
                            this.notification = notification;
                        }
                    }
                    if (invoker.BufferedReceiveManager != null)
                    {
                        ReceiveContext.TryGet(this.operationContext.IncomingMessageProperties, out this.receiveContext);
                    }
                    flag  = this.Process();
                    flag2 = true;
                }
                finally
                {
                    if (!flag2)
                    {
                        Finally(this, null);
                    }
                }
                if (flag)
                {
                    base.Complete(true);
                }
            }
            public ControlOperationAsyncResult(ControlOperationInvoker invoker, object[] inputs, IInvokeReceivedNotification notification, TimeSpan timeout,
                AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.invoker = invoker;
                this.inputs = inputs;
                this.timeoutHelper = new TimeoutHelper(timeout);
                this.transaction = Transaction.Current;
                this.operationContext = OperationContext.Current;
                this.OnCompleting = onCompleting;

                bool completeSelf = false;
                bool success = false;
                try
                {
                    if (notification != null)
                    {
                        if (this.operationContext.SessionId == null)
                        {
                            // Datagram messages are completely concurrent to loadOrCreate and instance operations. Same as WCF's ConcurrencyMode.Single
                            notification.NotifyInvokeReceived();
                        }
                        else
                        {
                            // For session, we will notify after we enter into WorkflowServiceInstance pending queue.
                            // This achieves synchronization and ordered messages within a session and concurrent across distinct sessions.
                            this.notification = notification;
                        }
                    }

                    if (invoker.BufferedReceiveManager != null)
                    {
                        if (!ReceiveContext.TryGet(this.operationContext.IncomingMessageProperties, out this.receiveContext))
                        {
                            Fx.Assert("ReceiveContext expected when BufferedReceives are enabled");
                        }
                    }

                    completeSelf = this.Process();
                    success = true;
                }
                finally
                {
                    // in the success cases, OnCompleting has us covered
                    if (!success)
                    {
                        Finally(this, null);
                    }
                }

                if (completeSelf)
                {
                    this.Complete(true);
                }
            }
 private RunAndGetResponseAsyncResult(ControlOperationInvoker.ControlOperationAsyncResult control, TimeoutHelper timeoutHelper, AsyncCallback callback, object state) : base(callback, state)
 {
     this.control = control;
     this.timeoutHelper = timeoutHelper;
     bool flag = true;
     if (control.getInstanceContext.WorkflowCreationContext.CreateOnly)
     {
         flag = this.Suspend();
     }
     else
     {
         flag = this.Run();
     }
     if (flag)
     {
         base.Complete(true);
     }
 }
 public static ControlOperationInvoker.ControlOperationAsyncResult.RunAndGetResponseAsyncResult Create(ControlOperationInvoker.ControlOperationAsyncResult control, TimeoutHelper timeoutHelper, AsyncCallback callback, object state)
 {
     return new ControlOperationInvoker.ControlOperationAsyncResult.RunAndGetResponseAsyncResult(control, timeoutHelper, callback, state);
 }
 public ControlOperationAsyncResult(ControlOperationInvoker invoker, object[] inputs, IInvokeReceivedNotification notification, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.instanceKey = InstanceKey.InvalidKey;
     this.additionalKeys = emptyKeyCollection;
     this.outputs = ControlOperationInvoker.emptyObjectArray;
     this.invoker = invoker;
     this.inputs = inputs;
     this.timeoutHelper = new TimeoutHelper(timeout);
     this.transaction = Transaction.Current;
     this.operationContext = OperationContext.Current;
     base.OnCompleting = onCompleting;
     bool flag = false;
     bool flag2 = false;
     try
     {
         if (notification != null)
         {
             if (this.operationContext.SessionId == null)
             {
                 notification.NotifyInvokeReceived();
             }
             else
             {
                 this.notification = notification;
             }
         }
         if (invoker.BufferedReceiveManager != null)
         {
             ReceiveContext.TryGet(this.operationContext.IncomingMessageProperties, out this.receiveContext);
         }
         flag = this.Process();
         flag2 = true;
     }
     finally
     {
         if (!flag2)
         {
             Finally(this, null);
         }
     }
     if (flag)
     {
         base.Complete(true);
     }
 }