protected override void Cancel(NativeActivityContext context) { if (!this.suppressCancel.Get(context)) { context.CancelChildren(); } }
private void OnWorkItemCanceled(NativeActivityContext context, Bookmark bookmark, object value) { if (!_suppressCancel.Get(context)) { context.CancelChildren(); } }
protected override void Cancel(NativeActivityContext context) { if (!this.state.Get(context).SuppressCancel) { context.CancelChildren(); } }
private void OnCompleted(NativeActivityContext context, ActivityInstance instance, T newResult) { bool set = isSet.Get(context); if (set) { T res = firstResult.Get(context); bool equal; if (res != null && newResult != null) { equal = newResult.Equals(res); } else { equal = false; } Result.Set(context, equal); if (!equal) { context.CancelChildren(); } } else { firstResult.Set(context, newResult); isSet.Set(context, true); } }
void OnFinish(NativeActivityContext context, Bookmark bookmark, object o) { var twilio = context.GetExtension <ITwilioContext>(); var r = (NameValueCollection)o; var result = r["QueueResult"]; var sid = r["QueueSid"]; var time = r["QueueTime"]; // set result values if (result != null) { Result.Set(context, ParseResult(result)); } if (sid != null) { Sid.Set(context, sid); } if (time != null) { Time.Set(context, TimeSpan.FromSeconds(int.Parse(time))); } // cancel all outstanding activities context.RemoveAllBookmarks(); context.CancelChildren(); }
private void OnNext(NativeActivityContext context, Bookmark bookmark, object value) { context.CancelChildren(); if (value is Bookmark b) { context.ResumeBookmark(b, value); } }
private void OnConditionComplete(NativeActivityContext context, ActivityInstance completedInstance, bool result) { if (result) { context.CancelChildren(); _hasCompleted.Set(context, true); } }
private void OnChildComplete(NativeActivityContext context, ActivityInstance completedInstance, bool result) { if (result) { context.CancelChildren(); this.Result.Set(context, true); } }
protected override void Cancel(NativeActivityContext context) { //not required since this is the default behavior. but should //get in the habit of adding this code anytime you //schedule execution of an activity Console.WriteLine("Cancel"); context.CancelChildren(); }
protected override void Cancel(NativeActivityContext context) { Console.WriteLine("Cancel"); if (context.IsCancellationRequested) { Console.WriteLine("IsCancellationRequested"); context.CancelChildren(); } }
protected override void Cancel(NativeActivityContext context) { bool suppressCancel = this.suppressCancel.Get(context); if (!suppressCancel) { context.CancelChildren(); } }
protected override void Cancel(NativeActivityContext context) { TryCatchState state = this.state.Get(context); if (!state.SuppressCancel) { context.CancelChildren(); } }
private void OnContinue(NativeActivityContext context, Bookmark bookmark, object value) { context.CancelChildren(); Bookmark _bookmark = value as Bookmark; if (_bookmark != null) { context.ResumeBookmark(_bookmark, value); } }
protected override void Cancel(NativeActivityContext context) { base.Cancel(context); context.CancelChildren(); if (_bodyError.Get(context) == null) { context.GetExtension <CriticalSectionQueueExtension>() .Exit(_resumeBookmark.Get(context), QueueName.Get(context)); } }
private void OnBreak(NativeActivityContext context, Bookmark bookmark, object value) { context.CancelChildren(); breakRequested = true; Bookmark _bookmark = value as Bookmark; if (_bookmark != null) { context.ResumeBookmark(_bookmark, value); } }
protected override void Cancel(NativeActivityContext context) { if (this.CompletionCondition == null) { base.Cancel(context); } else { context.CancelChildren(); } }
protected override void Cancel(NativeActivityContext context) { if (this.CompletionCondition == null) { base.Cancel(context); } else { context.CancelChildren(); } }
/// <summary> /// Invoked when digits are available. /// </summary> /// <param name="context"></param> /// <param name="bookmark"></param> /// <param name="o"></param> void OnFinish(NativeActivityContext context, Bookmark bookmark, object o) { var r = (NameValueCollection)o; var digits = r["Digits"] ?? ""; Result.Set(context, digits); Digits.Set(context, digits); // cancel all children context.RemoveAllBookmarks(); context.CancelChildren(); }
private void CleanUp(NativeActivityContext context) { try { StopMonitoring(context); } finally { // Clean-up even if there is an exception in the derived class. context.RemoveBookmark(_triggerBookmark); context.CancelChildren(); } }
protected override void Cancel(NativeActivityContext context) { context.CancelChildren(); var bookmark = bookmarkProgress.Get(context); var extension = context.GetExtension <Hosting.FileCopyExtension>(); extension.Cancel(bookmark.Name); this.noPersistHandle.Get(context).Exit(context); context.RemoveBookmark(bookmark); context.MarkCanceled(); }
protected override void Cancel(NativeActivityContext context) { // If we don't have a completion condition then we can just // use default logic. if (this.CompletionCondition == null) { base.Cancel(context); } else { context.CancelChildren(); } }
private void PrepareForExit(NativeActivityContext context, string targetStateId) { ReadOnlyCollection <System.Activities.ActivityInstance> children = context.GetChildren(); base.Result.Set(context, targetStateId); this.isExiting.Set(context, true); if (children.Count > 0) { context.CancelChildren(); } else { this.ScheduleExit(context); } }
void PrepareForExit(NativeActivityContext context, string targetStateId) { ReadOnlyCollection<ActivityInstance> children = context.GetChildren(); this.Result.Set(context, targetStateId); this.isExiting.Set(context, true); if (children.Count > 0) { // Cancel all other pending triggers. context.CancelChildren(); } else { this.ScheduleExit(context); } }
void PrepareForExit(NativeActivityContext context, string targetStateId) { Debug.Assert(!this.hasRunningChildState.Get(context), "There should not be any running child state."); ReadOnlyCollection <ActivityInstance> children = context.GetChildren(); this.Result.Set(context, targetStateId); this.isExiting.Set(context, true); if (children.Count > 0) { // Cancel all other pending triggers. context.CancelChildren(); } else { ScheduleExit(context); } }
void OnConditionComplete(NativeActivityContext context, ActivityInstance completedInstance, bool result) { if (result) { context.CancelChildren(); this.hasCompleted.Set(context, true); } else { // get the next child and schedule it! IEnumerator <T> enumerator = this.valueEnumerator.Get(context); if (this.valueEnumerator.Get(context).MoveNext()) { context.ScheduleAction(this.Body, this.valueEnumerator.Get(context).Current, onBodyComplete); } } }
/// <summary> /// Invoked when digits are available. /// </summary> /// <param name="context"></param> /// <param name="bookmark"></param> /// <param name="o"></param> void OnAction(NativeActivityContext context, Bookmark bookmark, object o) { var r = (NameValueCollection)o; var sid = r["RecordingSid"]; var url = r["RecordingUrl"]; var duration = r["RecordingDuration"]; var digits = r["Digits"]; Sid.Set(context, sid); Url.Set(context, url != null ? new Uri(url, UriKind.RelativeOrAbsolute) : null); Duration.Set(context, duration != null ? TimeSpan.FromSeconds(int.Parse(duration)) : TimeSpan.Zero); Digits.Set(context, digits); Result.Set(context, Url.Get(context)); // cancel all children context.RemoveAllBookmarks(); context.CancelChildren(); }
/// <summary> /// Invoked when digits are available. /// </summary> /// <param name="context"></param> /// <param name="bookmark"></param> /// <param name="o"></param> void OnFinish(NativeActivityContext context, Bookmark bookmark, object o) { var r = (NameValueCollection)o; var status = r["DialCallStatus"]; var sid = r["DialCallSid"]; var duration = r["DialCallDuration"]; var recordingUrl = r["RecordingUrl"]; // set output arguments Result.Set(context, status != null ? ParseCallStatus(status) : DialCallStatus.Unknown); Status.Set(context, status != null ? ParseCallStatus(status) : DialCallStatus.Unknown); Sid.Set(context, sid); Duration.Set(context, duration != null ? TimeSpan.FromSeconds(int.Parse(duration)) : TimeSpan.Zero); RecordingUrl.Set(context, recordingUrl != null ? new Uri(recordingUrl) : null); // cancel all children context.RemoveAllBookmarks(); context.CancelChildren(); }
public void Cancel(NativeActivityContext context) { bool bookmarkResumed = _bookmarkResumed.Get(context); if (!bookmarkResumed) { CancellationTokenSource cancellationTokenSource = _cancellationTokenSource.Get(context); cancellationTokenSource.Cancel(); cancellationTokenSource.Dispose(); } context.MarkCanceled(); // Overriding the Cancel method inhibits the propagation of cancellation requests to children. context.CancelChildren(); if (!bookmarkResumed) { _noPersistHandle.Get(context).Exit(context); } }
protected override void Cancel(NativeActivityContext context) { context.CancelChildren(); }
protected override void Cancel(NativeActivityContext context) { // If we don't have a completion condition then we can just // use default logic. if (this.CompletionCondition == null) { base.Cancel(context); } else { context.CancelChildren(); } }
void OnConditionComplete(NativeActivityContext context, ActivityInstance completedInstance, bool result) { if (result) { context.CancelChildren(); this.hasCompleted.Set(context, true); } }
protected override void Cancel(NativeActivityContext context) { context.CancelChildren(); var bookmark = bookmarkProgress.Get(context); var extension = context.GetExtension<Hosting.FileCopyExtension>(); extension.Cancel(bookmark.Name); this.noPersistHandle.Get(context).Exit(context); context.RemoveBookmark(bookmark); context.MarkCanceled(); }
protected void DisposeMonitor(NativeActivityContext context) { context.RemoveBookmark(this._monitorBookmark); context.CancelChildren(); }
private void OnContinue(NativeActivityContext context, Bookmark bookmark, object value) { context.CancelChildren(); context.ScheduleActivity(Condition, ConditionCompletion); }
/// <summary> /// The on receive completed. /// </summary> /// <param name="context"> /// The context. /// </param> /// <param name="completedInstance"> /// The completed instance. /// </param> private void OnReceiveCompleted( NativeActivityContext context, ActivityInstance completedInstance) { // Cancel the remaining children context.CancelChildren(); }
private void OnBreak(NativeActivityContext context, Bookmark bookmark, object value) { context.CancelChildren(); }
protected override void Cancel(NativeActivityContext context) { context.CancelChildren(); }