public void CleanupWorkflowThread(ref Exception abortException)
 {
     if (this.threadProperties != null)
     {
         for (int i = this.threadProperties.Count - 1; i >= 0; i--)
         {
             ExecutionProperty property = this.threadProperties[i];
             if (property.ShouldSkipNextCleanup)
             {
                 property.ShouldSkipNextCleanup = false;
             }
             else
             {
                 IExecutionProperty property2 = (IExecutionProperty)property.Property;
                 try
                 {
                     property2.CleanupWorkflowThread();
                 }
                 catch (Exception exception)
                 {
                     if (Fx.IsFatal(exception))
                     {
                         throw;
                     }
                     abortException = exception;
                 }
             }
             if (property.ShouldBeRemovedAfterCleanup)
             {
                 this.threadProperties.RemoveAt(i);
                 property.ShouldBeRemovedAfterCleanup = false;
             }
         }
     }
 }
Esempio n. 2
0
        public void SetupWorkflowThread()
        {
            if (this.threadProperties != null)
            {
                for (int i = 0; i < this.threadProperties.Count; i++)
                {
                    ExecutionProperty executionProperty = this.threadProperties[i];
                    executionProperty.ShouldSkipNextCleanup = false;
                    IExecutionProperty property = (IExecutionProperty)executionProperty.Property;

                    property.SetupWorkflowThread();
                }
            }
        }
Esempio n. 3
0
        // This method only throws fatal exceptions
        public void CleanupWorkflowThread(ref Exception abortException)
        {
            if (_threadProperties != null)
            {
                for (int i = _threadProperties.Count - 1; i >= 0; i--)
                {
                    ExecutionProperty current = _threadProperties[i];

                    if (current.ShouldSkipNextCleanup)
                    {
                        current.ShouldSkipNextCleanup = false;
                    }
                    else
                    {
                        IExecutionProperty property = (IExecutionProperty)current.Property;

                        try
                        {
                            property.CleanupWorkflowThread();
                        }
                        catch (Exception e)
                        {
                            if (Fx.IsFatal(e))
                            {
                                throw;
                            }

                            abortException = e;
                        }
                    }

                    if (current.ShouldBeRemovedAfterCleanup)
                    {
                        _threadProperties.RemoveAt(i);
                        current.ShouldBeRemovedAfterCleanup = false;
                    }
                }
            }
        }