本文整理汇总了C#中NativeActivityContext.RemoveBookmark方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.RemoveBookmark方法的具体用法?C# NativeActivityContext.RemoveBookmark怎么用?C# NativeActivityContext.RemoveBookmark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityContext
的用法示例。
在下文中一共展示了NativeActivityContext.RemoveBookmark方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cancel
protected override void Cancel(NativeActivityContext context)
{
Bookmark bookmark = this.timerBookmark.Get(context);
this.GetTimerExtension(context).CancelTimer(bookmark);
context.RemoveBookmark(bookmark);
context.MarkCanceled();
}
示例2: Cancel
protected override void Cancel(NativeActivityContext context)
{
Bookmark bookmark = this.bookmark.Get(context);
if (bookmark != null)
{
context.RemoveBookmark(bookmark);
}
base.Cancel(context);
}
示例3: RemoveBookmark
internal void RemoveBookmark(NativeActivityContext context, CompensationBookmarkName bookmarkName)
{
Bookmark bookmark = this.BookmarkTable[bookmarkName];
if (bookmark != null)
{
context.RemoveBookmark(bookmark);
this.BookmarkTable[bookmarkName] = null;
}
}
示例4: Cancel
protected override void Cancel(NativeActivityContext context)
{
Bookmark bookmark = timerExpiredBookmark.Get(context);
if (bookmark != null)
{
context.GetTimerExtension().CancelTimer(bookmark);
context.RemoveBookmark(bookmark);
}
context.MarkCanceled();
}
示例5: OnExtensionProgress
private void OnExtensionProgress(NativeActivityContext context, Bookmark bookmark, Object data)
{
if (bookmarkProgress.Get(context) != bookmark)
return;
if (data is int && !context.IsCancellationRequested)
{
Track(context, data);
if (this.OnProgress != null)
context.ScheduleAction<int>(this.OnProgress, (int)data);
}
else
{
this.noPersistHandle.Get(context).Exit(context);
context.RemoveBookmark(bookmark);
if (data is Exception)
throw data as Exception;
}
}
示例6: Cancel
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();
}
示例7: OnMainRootComplete
void OnMainRootComplete(NativeActivityContext context, Bookmark bookmark, object value)
{
CompensationExtension compensationExtension = context.GetExtension<CompensationExtension>();
Fx.Assert(compensationExtension != null, "CompensationExtension must be valid");
CompensationTokenData rootHandle = compensationExtension.Get(CompensationToken.RootCompensationId);
Fx.Assert(rootHandle != null, "rootToken must be valid");
ActivityInstanceState completionState = (ActivityInstanceState)value;
if (completionState == ActivityInstanceState.Closed)
{
context.ResumeBookmark(compensationExtension.WorkflowConfirmation, new CompensationToken(rootHandle));
}
else if (completionState == ActivityInstanceState.Canceled)
{
context.ResumeBookmark(compensationExtension.WorkflowCompensation, new CompensationToken(rootHandle));
}
else if (completionState == ActivityInstanceState.Faulted)
{
// Do nothing. Neither Compensate nor Confirm.
// Remove the bookmark to complete the WorkflowCompensationBehavior execution.
context.RemoveBookmark(compensationExtension.WorkflowConfirmation);
context.RemoveBookmark(compensationExtension.WorkflowCompensation);
}
}
示例8: OnConfirmationComplete
void OnConfirmationComplete(NativeActivityContext context, ActivityInstance completedInstance)
{
CompensationExtension compensationExtension = context.GetExtension<CompensationExtension>();
Fx.Assert(compensationExtension != null, "CompensationExtension must be valid");
context.RemoveBookmark(compensationExtension.WorkflowCompensation);
}
示例9: OnBookmarkCallback
private void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, object value)
{
if (this.Result != null)
this.Result.Set(context, value == null ? string.Empty : value.ToString());
context.RemoveBookmark(bookmark);
}
示例10: OnMainRootComplete
private void OnMainRootComplete(NativeActivityContext context, Bookmark bookmark, object value)
{
CompensationExtension extension = context.GetExtension<CompensationExtension>();
CompensationTokenData tokenData = extension.Get(0L);
switch (((ActivityInstanceState) value))
{
case ActivityInstanceState.Closed:
context.ResumeBookmark(extension.WorkflowConfirmation, new CompensationToken(tokenData));
return;
case ActivityInstanceState.Canceled:
context.ResumeBookmark(extension.WorkflowCompensation, new CompensationToken(tokenData));
return;
case ActivityInstanceState.Faulted:
context.RemoveBookmark(extension.WorkflowConfirmation);
context.RemoveBookmark(extension.WorkflowCompensation);
break;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:WorkflowCompensationBehavior.cs
示例11: OnConfirmationComplete
private void OnConfirmationComplete(NativeActivityContext context, System.Activities.ActivityInstance completedInstance)
{
CompensationExtension extension = context.GetExtension<CompensationExtension>();
context.RemoveBookmark(extension.WorkflowCompensation);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:WorkflowCompensationBehavior.cs
示例12: Cancel
protected override void Cancel(NativeActivityContext context)
{
SendReceiveExtension sendReceiveExtension = context.GetExtension<SendReceiveExtension>();
if (sendReceiveExtension != null)
{
Bookmark pendingBookmark = this.extensionReceiveBookmark.Get(context);
if (pendingBookmark != null)
{
sendReceiveExtension.Cancel(pendingBookmark);
context.RemoveBookmark(pendingBookmark);
}
}
base.Cancel(context);
}
示例13: OnDelayBookmarkCallback
//延迟书签回调
private void OnDelayBookmarkCallback(NativeActivityContext context, Bookmark bookmark, object value)
{
context.RemoveBookmark(bookmark);
//删除延迟书签后直接执行主体
this.InternalExecuteBody(context);
}
示例14: OnBookmarkCallback
private void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark)
{
var log = context.Resolve<ILoggerFactory>() != null
? context.Resolve<ILoggerFactory>().Create(typeof(SubProcess))
: null;
var parser = context.Resolve<IScriptParser>();
var extension = context.GetExtension<DataFieldExtension>();
//完成规则解析
if (this.Result != null
&& parser != null
&& this.FinishRule != null
&& this.FinishRule.Count > 0)
{
foreach (var i in this.FinishRule)
if (parser.EvaluateRule(i.Value, extension))
{
this.Result.Set(context, i.Key);
if (log != null)
log.InfoFormat("SubProcess节点完成规则“{0}”测试通过,将进入节点“{1}”", i.Value, i.Key);
break;
}
}
//所有逻辑完成才可删除,若上述逻辑失败则将此书签用于错误恢复
context.RemoveBookmark(bookmark);
}