public FlushPendingRecordsAsyncResult(TrackingProvider provider, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.provider      = provider;
     this.timeoutHelper = new TimeoutHelper(timeout);
     if (this.RunLoop())
     {
         base.Complete(true);
     }
 }
예제 #2
0
 private void InitializeCore(IDictionary <string, object> workflowArgumentValues, IList <Handle> workflowExecutionProperties)
 {
     if (this.extensions != null)
     {
         this.extensions.Initialize();
         if (this.extensions.HasTrackingParticipant)
         {
             this.HasTrackingParticipant = true;
             this.trackingProvider       = new System.Activities.Tracking.TrackingProvider(this.WorkflowDefinition);
             foreach (TrackingParticipant participant in this.GetExtensions <TrackingParticipant>())
             {
                 this.trackingProvider.AddParticipant(participant);
             }
         }
     }
     else
     {
         this.ValidateWorkflow(null);
     }
     this.WorkflowDefinition.HasBeenAssociatedWithAnInstance = true;
     if (workflowArgumentValues != null)
     {
         IDictionary <string, object> objA = workflowArgumentValues;
         if (object.ReferenceEquals(objA, ActivityUtilities.EmptyParameters))
         {
             objA = null;
         }
         if ((this.WorkflowDefinition.RuntimeArguments.Count > 0) || ((objA != null) && (objA.Count > 0)))
         {
             ActivityValidationServices.ValidateRootInputs(this.WorkflowDefinition, objA);
         }
         this.executor.ScheduleRootActivity(this.WorkflowDefinition, objA, workflowExecutionProperties);
     }
     else
     {
         this.executor.OnDeserialized(this.WorkflowDefinition, this);
     }
     this.executor.Open(this.SynchronizationContext);
     this.controller    = new WorkflowInstanceControl(this, this.executor);
     this.isInitialized = true;
     if ((this.extensions != null) && this.extensions.HasWorkflowInstanceExtensions)
     {
         WorkflowInstanceProxy instance = new WorkflowInstanceProxy(this);
         for (int i = 0; i < this.extensions.WorkflowInstanceExtensions.Count; i++)
         {
             this.extensions.WorkflowInstanceExtensions[i].SetInstance(instance);
         }
     }
 }
            public FlushPendingRecordsAsyncResult(TrackingProvider provider, TimeSpan timeout, AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.provider = provider;
                this.timeoutHelper = new TimeoutHelper(timeout);

                if (RunLoop())
                {
                    Complete(true);
                }
            }