本文整理汇总了C#中NativeActivityMetadata.SetVariablesCollection方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityMetadata.SetVariablesCollection方法的具体用法?C# NativeActivityMetadata.SetVariablesCollection怎么用?C# NativeActivityMetadata.SetVariablesCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityMetadata
的用法示例。
在下文中一共展示了NativeActivityMetadata.SetVariablesCollection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddChild(this.Body);
metadata.AddChild(this.CancellationHandler);
metadata.SetVariablesCollection(this.Variables);
metadata.AddImplementationVariable(this.suppressCancel);
}
示例2: CacheMetadata
/// <summary>
/// Creates and validates a description of the activity’s arguments, variables, child activities, and activity delegates.
/// </summary>
/// <param name="metadata">The activity’s metadata that encapsulates the activity’s arguments, variables, child activities, and activity delegates.</param>
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
foreach (var kvp in this.Arguments)
{
metadata.AddArgument(new RuntimeArgument(kvp.Key, kvp.Value.ArgumentType, kvp.Value.Direction));
}
metadata.SetVariablesCollection(this.Variables);
metadata.AddChild(this.StateMachine);
}
示例3: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.SetVariablesCollection(this.Variables);
metadata.AddChild(this.Body);
if (this.Condition == null)
{
metadata.AddValidationError(System.Activities.SR.WhileRequiresCondition(base.DisplayName));
}
else
{
metadata.AddChild(this.Condition);
}
}
示例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
/// <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);
}
示例6: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.SetChildrenCollection(this.Activities);
metadata.SetVariablesCollection(this.Variables);
metadata.AddImplementationVariable(this.lastIndexHint);
}
示例7: CacheMetadata
/// <summary>
/// Informs the runtime about our activity and the data
/// </summary>
/// <param name="metadata">The metadata</param>
/// <remarks>
/// The base class implementation
/// will discover variables and child activities using reflection. By overriding
/// CacheMetadata we avoid this and get improved performance.
/// </remarks>
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
/// implementation variables are variables that are
/// private to our workflow.
metadata.AddImplementationVariable(lastIndexHint);
metadata.AddImplementationVariable(preCompleted);
metadata.AddImplementationVariable(bodyCompleted);
metadata.SetVariablesCollection(Variables);
metadata.AddChild(Pre);
metadata.AddChild(Post);
// Cannot use metadata.SetActivitiesCollection because of Pre/Post
foreach (Activity activity in Activities)
{
metadata.AddChild(activity);
}
}