示例#1
0
 public override ActivityExecutionStatus Execute(Activity activity, ActivityExecutionContext executionContext)
 {
     if (executionContext == null)
     {
         throw new ArgumentNullException("executionContext");
     }
     if (activity == null)
     {
         throw new ArgumentNullException("activity");
     }
     if (!activity.SupportsTransaction)
     {
         throw new ArgumentException("activity");
     }
     activity.RegisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
     activity.HoldLockOnStatusChange(this);
     return(ExecuteActivity(activity, executionContext, false));
 }
 public override ActivityExecutionStatus Execute(Activity activity, ActivityExecutionContext executionContext)
 {
     if (executionContext == null)
     {
         throw new ArgumentNullException("executionContext");
     }
     if (activity == null)
     {
         throw new ArgumentNullException("activity");
     }
     activity.RegisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
     activity.HoldLockOnStatusChange(this);
     if (executionContext.AcquireLocks(this))
     {
         return(this.ExecuteActivityNow(executionContext));
     }
     return(activity.ExecutionStatus);
 }