本文整理汇总了C#中NativeActivityContext.RemoveAllBookmarks方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.RemoveAllBookmarks方法的具体用法?C# NativeActivityContext.RemoveAllBookmarks怎么用?C# NativeActivityContext.RemoveAllBookmarks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityContext
的用法示例。
在下文中一共展示了NativeActivityContext.RemoveAllBookmarks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBranchComplete
private void OnBranchComplete(NativeActivityContext context, System.Activities.ActivityInstance completedInstance)
{
PickState pickState = this.pickStateVariable.Get(context);
ReadOnlyCollection<System.Activities.ActivityInstance> children = context.GetChildren();
switch (completedInstance.State)
{
case ActivityInstanceState.Closed:
pickState.HasBranchCompletedSuccessfully = true;
break;
case ActivityInstanceState.Canceled:
case ActivityInstanceState.Faulted:
if ((context.IsCancellationRequested && (children.Count == 0)) && !pickState.HasBranchCompletedSuccessfully)
{
context.MarkCanceled();
context.RemoveAllBookmarks();
}
break;
}
if ((children.Count == 1) && (pickState.ExecuteActionBookmark != null))
{
this.ResumeExecutionActionBookmark(pickState, context);
}
}
示例2: ReceiveCallback
/// <summary>
/// The receive callback.
/// </summary>
/// <param name="context">
/// The context.
/// </param>
/// <param name="bookmark">
/// The bookmark.
/// </param>
/// <param name="value">
/// The value.
/// </param>
private void ReceiveCallback(NativeActivityContext context, Bookmark bookmark, object value)
{
context.RemoveAllBookmarks();
this.receiveContext = (IHttpWorkflowReceiveContext)value;
this.hostContext = context.GetExtension<IHttpWorkflowHostContext>();
// bind the parameters using the UriTemplate
var match = this.hostContext.MatchSingle(this.receiveContext.Request);
this.noPersistHandle.Get(context).Enter(context);
// TODO: Consider fault handling - do we need to do anything special?
context.ScheduleFunc(
this.Body,
this.receiveContext.Request,
match.BoundVariables.AllKeys.ToDictionary(s => s, key => match.BoundVariables[key]),
this.OnBodyCompleted);
}
示例3: Cancel
protected override void Cancel(NativeActivityContext context)
{
var subscriptionHandle = this.SubscriptionHandle.Get(context);
subscriptionHandle.ReleaseSubscription(context.GetExtension<Hosting.FolderWatcherExtension>());
context.RemoveAllBookmarks();
context.MarkCanceled();
}