Beispiel #1
0
 public bool FlushTracking(ActivityExecutor executor)
 {
     try
     {
         if (trackingCallback == null)
         {
             trackingCallback = Fx.ThunkCallback(new AsyncCallback(System.Activities.Runtime.WorkItem.OnTrackingComplete));
         }
         IAsyncResult result = executor.BeginTrackPendingRecords(trackingCallback, new CallbackData(executor, this));
         if (result.CompletedSynchronously)
         {
             executor.EndTrackPendingRecords(result);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         this.workflowAbortException = exception;
     }
     return(true);
 }
Beispiel #2
0
        public bool FlushTracking(ActivityExecutor executor)
        {
            Fx.Assert(executor.HasPendingTrackingRecords, "We should not have been called if we don't have pending tracking records");

            try
            {
                if (s_trackingCallback == null)
                {
                    s_trackingCallback = Fx.ThunkCallback(new AsyncCallback(OnTrackingComplete));
                }

                IAsyncResult result = executor.BeginTrackPendingRecords(
                    s_trackingCallback,
                    new CallbackData(executor, this));

                if (result.CompletedSynchronously)
                {
                    executor.EndTrackPendingRecords(result);
                }
                else
                {
                    // Completed async so we'll return false
                    return(false);
                }
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                this.workflowAbortException = e;
            }

            return(true);
        }
 public bool FlushTracking(ActivityExecutor executor)
 {
     try
     {
         if (trackingCallback == null)
         {
             trackingCallback = Fx.ThunkCallback(new AsyncCallback(System.Activities.Runtime.WorkItem.OnTrackingComplete));
         }
         IAsyncResult result = executor.BeginTrackPendingRecords(trackingCallback, new CallbackData(executor, this));
         if (result.CompletedSynchronously)
         {
             executor.EndTrackPendingRecords(result);
         }
         else
         {
             return false;
         }
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         this.workflowAbortException = exception;
     }
     return true;
 }
        public bool FlushTracking(ActivityExecutor executor)
        {
            Fx.Assert(executor.HasPendingTrackingRecords, "We should not have been called if we don't have pending tracking records");

            try
            {
                if (trackingCallback == null)
                {
                    trackingCallback = Fx.ThunkCallback(new AsyncCallback(OnTrackingComplete));
                }

                IAsyncResult result = executor.BeginTrackPendingRecords(
                    trackingCallback,
                    new CallbackData(executor, this));

                if (result.CompletedSynchronously)
                {
                    executor.EndTrackPendingRecords(result);
                }
                else
                {
                    // Completed async so we'll return false
                    return false;
                }
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                this.workflowAbortException = e;
            }

            return true;
        }