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


C# NativeActivityMetadata.SetChildrenCollection方法代码示例

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


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

示例1: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     if (this.branchBodies == null)
     {
         this.branchBodies = new Collection<Activity>();
     }
     else
     {
         this.branchBodies.Clear();
     }
     foreach (PickBranch branch in this.Branches)
     {
         if (branch.Trigger == null)
         {
             metadata.AddValidationError(System.Activities.SR.PickBranchRequiresTrigger(branch.DisplayName));
         }
         PickBranchBody item = new PickBranchBody {
             Action = branch.Action,
             DisplayName = branch.DisplayName,
             Trigger = branch.Trigger,
             Variables = branch.Variables
         };
         this.branchBodies.Add(item);
     }
     metadata.SetChildrenCollection(this.branchBodies);
     metadata.AddImplementationVariable(this.pickStateVariable);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:Pick.cs

示例2: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            RuntimeArgument valuesArgument = new RuntimeArgument("Values", typeof(IEnumerable), ArgumentDirection.In, true);
            metadata.Bind(this.Values, valuesArgument);
            metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { valuesArgument });

            // declare the CompletionCondition as a child
            if (this.CompletionCondition != null)
            {
                metadata.SetChildrenCollection(new Collection<Activity> { this.CompletionCondition });
            }

            // declare the hasCompleted variable
            if (this.CompletionCondition != null)
            {
                if (this.hasCompleted == null)
                {
                    this.hasCompleted = new Variable<bool>();
                }

                metadata.AddImplementationVariable(this.hasCompleted);
            }

            metadata.AddDelegate(this.Body);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:25,代码来源:ParallelForEach.cs

示例3: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     RuntimeArgument argument = new RuntimeArgument("Condition", typeof(bool), ArgumentDirection.In, true);
     metadata.Bind(this.Condition, argument);
     metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { argument });
     Collection<Activity> collection = null;
     if (this.Then != null)
     {
         ActivityUtilities.Add<Activity>(ref collection, this.Then);
     }
     if (this.Else != null)
     {
         ActivityUtilities.Add<Activity>(ref collection, this.Else);
     }
     metadata.SetChildrenCollection(collection);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:If.cs

示例4: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     Collection<Activity> children = new Collection<Activity>();
     foreach (Activity activity in this.Branches)
     {
         children.Add(activity);
     }
     if (this.CompletionCondition != null)
     {
         children.Add(this.CompletionCondition);
     }
     metadata.SetChildrenCollection(children);
     metadata.SetVariablesCollection(this.Variables);
     if (this.CompletionCondition != null)
     {
         if (this.hasCompleted == null)
         {
             this.hasCompleted = new Variable<bool>();
         }
         metadata.AddImplementationVariable(this.hasCompleted);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:Parallel.cs

示例5: CacheMetadata

        //Cache composite activity metadata
        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            metadata.SetChildrenCollection(FilterActivities);

            base.CacheMetadata(metadata);
        }
开发者ID:EdiCarlos,项目名称:MyPractices,代码行数:7,代码来源:QueryFeed.cs

示例6: CacheMetadata

        /// <summary>
        /// The cache metadata.
        /// </summary>
        /// <param name="metadata">
        /// The metadata.
        /// </param>
        /// <exception cref="ValidationException">
        /// The workflow is invalid
        /// </exception>
        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            if (
                this.Receives.Any(
                    r => !r.GetType().IsAssignableFrom(typeof(HttpReceive))))
            {
                throw new ValidationException(
                    "HttpWorkflowService can contain only HttpReceive activities");
            }

            metadata.SetChildrenCollection(this.Receives);
            metadata.SetVariablesCollection(this.Variables);
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:22,代码来源:HttpWorkflowService.cs

示例7: CacheMetadata

 protected override void CacheMetadata(NativeActivityMetadata metadata)
 {
     metadata.SetChildrenCollection(this.Activities);
     metadata.SetVariablesCollection(this.Variables);
     metadata.AddImplementationVariable(this.lastIndexHint);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:Sequence.cs

示例8: CacheMetadata

        protected override void CacheMetadata(NativeActivityMetadata metadata)
        {
            metadata.SetImplementationVariablesCollection(
                new Collection<Variable>
                {
                    this.currentCompensationToken,
                });

            Collection<Activity> children = new Collection<Activity>();

            if (this.CompensationHandler != null)
            {
                children.Add(CompensationHandler);
            }

            if (this.ConfirmationHandler != null)
            {
                children.Add(ConfirmationHandler);
            }

            if (this.CancellationHandler != null)
            {
                children.Add(CancellationHandler);
            }

            metadata.SetChildrenCollection(children);

            Collection<Activity> implementationChildren = new Collection<Activity>();
            Fx.Assert(DefaultCompensation != null, "DefaultCompensation must be valid");
            implementationChildren.Add(DefaultCompensation);

            Fx.Assert(DefaultConfirmation != null, "DefaultConfirmation must be valid");
            implementationChildren.Add(DefaultConfirmation);

            metadata.SetImplementationChildrenCollection(implementationChildren);

            RuntimeArgument compensationIdArgument = new RuntimeArgument("CompensationId", typeof(long), ArgumentDirection.In);
            metadata.Bind(this.compensationId, compensationIdArgument);
            metadata.AddArgument(compensationIdArgument);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:40,代码来源:CompensationParticipant.cs


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