本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例5: CacheMetadata
//Cache composite activity metadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.SetChildrenCollection(FilterActivities);
base.CacheMetadata(metadata);
}
示例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);
}
示例7: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.SetChildrenCollection(this.Activities);
metadata.SetVariablesCollection(this.Variables);
metadata.AddImplementationVariable(this.lastIndexHint);
}
示例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);
}