protected override void Execute(NativeActivityContext context)
 {
     string str = this.Reason.Get(context);
     System.Exception innerException = this.Exception.Get(context);
     if (!string.IsNullOrEmpty(str))
     {
         context.Terminate(new WorkflowTerminatedException(str, innerException));
     }
     else if (innerException != null)
     {
         context.Terminate(innerException);
     }
     else
     {
         context.Terminate(new WorkflowTerminatedException());
     }
 }
        protected override void Execute(NativeActivityContext context)
        {
            string str = this.Reason.Get(context);

            System.Exception innerException = this.Exception.Get(context);
            if (!string.IsNullOrEmpty(str))
            {
                context.Terminate(new WorkflowTerminatedException(str, innerException));
            }
            else if (innerException != null)
            {
                context.Terminate(innerException);
            }
            else
            {
                context.Terminate(new WorkflowTerminatedException());
            }
        }
 protected override void Execute(NativeActivityContext context)
 {
     // If Reason is provided, we'll create a WorkflowApplicationTerminatedException from
     // it, wrapping Exception if it is also provided. Otherwise just use Exception.
     // If neither is provided just throw a new WorkflowTerminatedException.
     string reason = Reason.Get(context);
     Exception exception = Exception.Get(context);
     if (!string.IsNullOrEmpty(reason))
     {
         context.Terminate(new WorkflowTerminatedException(reason, exception));
     }
     else if (exception != null)
     {
         context.Terminate(exception);
     }
     else
     {
         context.Terminate(new WorkflowTerminatedException());
     }
 }
        protected override void Execute(NativeActivityContext context)
        {
            // If Reason is provided, we'll create a WorkflowApplicationTerminatedException from
            // it, wrapping Exception if it is also provided. Otherwise just use Exception.
            // If neither is provided just throw a new WorkflowTerminatedException.
            string    reason    = Reason.Get(context);
            Exception exception = Exception.Get(context);

            if (!string.IsNullOrEmpty(reason))
            {
                context.Terminate(new WorkflowTerminatedException(reason, exception));
            }
            else if (exception != null)
            {
                context.Terminate(exception);
            }
            else
            {
                context.Terminate(new WorkflowTerminatedException());
            }
        }