当前位置: 首页>>代码示例>>C#>>正文


C# NativeActivityContext.GetChildren方法代码示例

本文整理汇总了C#中NativeActivityContext.GetChildren方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.GetChildren方法的具体用法?C# NativeActivityContext.GetChildren怎么用?C# NativeActivityContext.GetChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NativeActivityContext的用法示例。


在下文中一共展示了NativeActivityContext.GetChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnHasCompleted

        protected override void OnHasCompleted(NativeActivityContext context, ActivityInstance completedInstance)
        {
            base.OnHasCompleted(context, completedInstance);

            //HACK:重写并行节点满足条件退出逻辑
            var e = context.GetExtension<ParallelExtension>();
            e.Cancelled(context.GetChildren()
                .Where(o => o.ID != completedInstance.ID)
                .Select(o => o.ID)
                .ToArray());
        }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:11,代码来源:CustomParallel.cs

示例2: 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);
            }
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:24,代码来源:Pick.cs

示例3: OnTriggerComplete

 private void OnTriggerComplete(NativeActivityContext context, Bookmark bookmark, object state)
 {
     PickState pickState = this.pickStateVariable.Get(context);
     string str = (string) state;
     ReadOnlyCollection<System.Activities.ActivityInstance> children = context.GetChildren();
     bool flag = true;
     for (int i = 0; i < children.Count; i++)
     {
         System.Activities.ActivityInstance activityInstance = children[i];
         if (activityInstance.Id != str)
         {
             context.CancelChild(activityInstance);
             flag = false;
         }
     }
     if (flag)
     {
         this.ResumeExecutionActionBookmark(pickState, context);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:Pick.cs


注:本文中的NativeActivityContext.GetChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。