本文整理汇总了C#中NativeActivityMetadata.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityMetadata.AddChild方法的具体用法?C# NativeActivityMetadata.AddChild怎么用?C# NativeActivityMetadata.AddChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityMetadata
的用法示例。
在下文中一共展示了NativeActivityMetadata.AddChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument argument;
argument = new RuntimeArgument("JobGuid", typeof(Guid), ArgumentDirection.In);
metadata.Bind(this.JobGuid, argument);
metadata.AddArgument(argument);
argument = new RuntimeArgument("UserGuid", typeof(Guid), ArgumentDirection.In);
metadata.Bind(this.UserGuid, argument);
metadata.AddArgument(argument);
if (this.Try != null)
{
metadata.AddChild(this.Try);
}
if (this.Finally != null)
{
metadata.AddChild(this.Finally);
}
argument = new RuntimeArgument("MaxRetries", typeof(int), ArgumentDirection.In);
metadata.Bind(this.MaxRetries, argument);
metadata.AddArgument(argument);
metadata.AddImplementationVariable(this.retries);
}
示例3: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
if (BatchingStrategy == null) metadata.AddValidationError("BatchingStrategy is required.");
if (GetNextVectors.IsNull()) metadata.AddValidationError("GetNextVectors function is required.");
if (ItemCountExpression == null) metadata.AddValidationError("ItemCountExpression is required.");
metadata.AddChild(BatchingStrategy);
metadata.AddDelegate(GetNextVectors);
metadata.AddDelegate(DoReinitializeVectorProvider);
RuntimeArgument arg;
metadata.AddArgument(arg = new RuntimeArgument("LastResult", typeof(BatchExecutionResult), ArgumentDirection.In));
metadata.Bind(LastResult, arg);
metadata.AddArgument(arg = new RuntimeArgument("ReinitializationFrequency", typeof(int), ArgumentDirection.In));
metadata.Bind(ReinitializationFrequency, arg);
metadata.AddArgument(arg = new RuntimeArgument("UseCache", typeof(bool), ArgumentDirection.In));
metadata.Bind(UseCache, arg);
metadata.AddChild(ItemCountExpression);
metadata.AddImplementationVariable(cachedVectors);
metadata.AddImplementationVariable(strategyHasJustInited);
base.CacheMetadata(metadata);
}
示例4: 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);
}
}
示例5: 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);
}
示例6: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
// activities
foreach (Activity activity in this.Activities)
{
metadata.AddChild(activity);
}
metadata.AddImplementationVariable(this.LastIndex);
metadata.AddImplementationVariable(this.ResumeParent);
}
示例7: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
base.CacheMetadata(metadata);
if (Body.IsNull()) metadata.AddValidationError("Body is required.");
metadata.AddDelegate(Body);
if (Condition == null) metadata.AddValidationError("Condition is required.");
metadata.AddChild(Condition);
}
示例8: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
if (this.Body == null)
{
metadata.AddValidationError("The Body property must contain an Activity.");
}
else if (impl == null)
{
CreateImplementation();
metadata.AddChild(impl);
}
}
示例9: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddChild(this.Body);
metadata.SetImplementationVariablesCollection(
new Collection<Variable>
{
this.declaredHandle
});
RuntimeArgument correlatesWithArgument = new RuntimeArgument("CorrelatesWith", typeof(CorrelationHandle), ArgumentDirection.In);
metadata.Bind(this.CorrelatesWith, correlatesWithArgument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { correlatesWithArgument });
}
示例10: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
// child activities
metadata.AddChild(this.Body);
// arguments
metadata.AddArgument(new RuntimeArgument("ConnectionString", typeof(string), ArgumentDirection.In, true));
// variables
metadata.AddImplementationVariable(this.noPersistHandle);
foreach (Variable variable in this.variables)
{
metadata.AddVariable(variable);
}
base.CacheMetadata(metadata);
}
示例11: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
if (GetBatchingStrategyFactory.IsNull()) metadata.AddValidationError("GetBatchingStrategyFactory function is expected.");
if (GetNextVectors.IsNull()) metadata.AddValidationError("GetNextVectors function is expected.");
if (ItemCount == null) metadata.AddValidationError("ItemCount expression expected.");
metadata.AddDelegate(GetBatchingStrategyFactory);
metadata.AddDelegate(GetNextVectors);
metadata.AddDelegate(ReinitializeVectorProvider);
RuntimeArgument arg;
metadata.AddArgument(arg = new RuntimeArgument("LastResult", typeof(BatchExecutionResult), ArgumentDirection.In));
metadata.Bind(LastResult, arg);
metadata.AddArgument(arg = new RuntimeArgument("ReinitializationFrequency", typeof(int), ArgumentDirection.In));
metadata.Bind(ReinitializationFrequency, arg);
metadata.AddChild(ItemCount);
base.CacheMetadata(metadata);
}
示例12: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddImplementationVariable(noPersistHandle);
metadata.AddChild(tryCatch);
//base.CacheMetadata(metadata); // it would add the public Body activity twice
}
示例13: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddChild(Body);
}
示例14: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
foreach (KeyValuePair<string, Argument> entry in this.DelegateArguments)
{
RuntimeArgument argument = new RuntimeArgument(entry.Key, entry.Value.ArgumentType, entry.Value.Direction);
metadata.Bind(entry.Value, argument);
arguments.Add(argument);
}
metadata.SetArgumentsCollection(arguments);
metadata.AddDelegate(this.Delegate);
if (this.Delegate != null)
{
IList<RuntimeDelegateArgument> targetDelegateArguments = this.Delegate.RuntimeDelegateArguments;
if (this.DelegateArguments.Count != targetDelegateArguments.Count)
{
metadata.AddValidationError(SR.WrongNumberOfArgumentsForActivityDelegate);
}
// Validate that the names and directionality of arguments in DelegateArguments dictionary
// match the names and directionality of arguments returned by the ActivityDelegate.GetDelegateParameters
// call above.
for (int i = 0; i < targetDelegateArguments.Count; i++)
{
RuntimeDelegateArgument expectedParameter = targetDelegateArguments[i];
Argument delegateArgument = null;
string parameterName = expectedParameter.Name;
if (this.DelegateArguments.TryGetValue(parameterName, out delegateArgument))
{
if (delegateArgument.Direction != expectedParameter.Direction)
{
metadata.AddValidationError(SR.DelegateParameterDirectionalityMismatch(parameterName, delegateArgument.Direction, expectedParameter.Direction));
}
if (expectedParameter.Direction == ArgumentDirection.In)
{
if (!TypeHelper.AreTypesCompatible(delegateArgument.ArgumentType, expectedParameter.Type))
{
metadata.AddValidationError(SR.DelegateInArgumentTypeMismatch(parameterName, expectedParameter.Type, delegateArgument.ArgumentType));
}
}
else
{
if (!TypeHelper.AreTypesCompatible(expectedParameter.Type, delegateArgument.ArgumentType))
{
metadata.AddValidationError(SR.DelegateOutArgumentTypeMismatch(parameterName, expectedParameter.Type, delegateArgument.ArgumentType));
}
}
}
else
{
metadata.AddValidationError(SR.InputParametersMissing(expectedParameter.Name));
}
if (!this.hasOutputArguments && ArgumentDirectionHelper.IsOut(expectedParameter.Direction))
{
this.hasOutputArguments = true;
}
}
}
metadata.AddChild(this.Default);
}
示例15: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddChild(this.Body);
metadata.AddImplementationVariable(this.noPersistHandle);
}