本文整理汇总了C#中NativeActivityMetadata.SetArgumentsCollection方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityMetadata.SetArgumentsCollection方法的具体用法?C# NativeActivityMetadata.SetArgumentsCollection怎么用?C# NativeActivityMetadata.SetArgumentsCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityMetadata
的用法示例。
在下文中一共展示了NativeActivityMetadata.SetArgumentsCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.AddImplementationVariable(outputText);
this.output = new WriteLine { Text = new InArgument<string>(outputText) };
metadata.AddImplementationChild(this.output);
metadata.SetArgumentsCollection(metadata.GetArgumentsWithReflection());
}
示例3: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument subInstanceArgument = new RuntimeArgument("Scope", typeof(BookmarkScope), ArgumentDirection.In);
metadata.Bind(this.Scope, subInstanceArgument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { subInstanceArgument });
}
示例4: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument targetArgument = new RuntimeArgument("Target", typeof(CompensationToken), ArgumentDirection.In);
metadata.Bind(this.Target, targetArgument);
metadata.SetArgumentsCollection(
new Collection<RuntimeArgument>
{
targetArgument
});
metadata.SetImplementationVariablesCollection(
new Collection<Variable>
{
this.currentCompensationToken
});
Fx.Assert(DefaultConfirmation != null, "DefaultConfirmation must be valid");
Fx.Assert(InternalConfirm != null, "InternalConfirm must be valid");
metadata.SetImplementationChildrenCollection(
new Collection<Activity>
{
DefaultConfirmation,
InternalConfirm
});
}
示例5: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument argument = new RuntimeArgument("Target", typeof(CompensationToken), ArgumentDirection.In);
metadata.Bind(this.Target, argument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { argument });
metadata.SetImplementationVariablesCollection(new Collection<Variable> { this.toConfirmToken });
metadata.SetImplementationChildrenCollection(new Collection<Activity> { this.Body });
}
示例6: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument argument = new RuntimeArgument("Duration", typeof(TimeSpan), ArgumentDirection.In, true);
metadata.Bind(this.Duration, argument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { argument });
metadata.AddImplementationVariable(this.timerBookmark);
metadata.AddDefaultExtensionProvider<TimerExtension>(getDefaultTimerExtension);
}
示例7: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.SetArgumentsCollection(
new Collection<RuntimeArgument>
{
this.toValidate,
this.violationList,
this.toValidateContext
});
}
示例8: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
foreach (KeyValuePair<string, Argument> pair in this.DelegateArguments)
{
RuntimeArgument argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, pair.Value.Direction);
metadata.Bind(pair.Value, argument);
arguments.Add(argument);
}
metadata.SetArgumentsCollection(arguments);
metadata.AddDelegate(this.Delegate);
if (this.Delegate != null)
{
IList<RuntimeDelegateArgument> runtimeDelegateArguments = this.Delegate.RuntimeDelegateArguments;
if (this.DelegateArguments.Count != runtimeDelegateArguments.Count)
{
metadata.AddValidationError(System.Activities.SR.WrongNumberOfArgumentsForActivityDelegate);
}
for (int i = 0; i < runtimeDelegateArguments.Count; i++)
{
RuntimeDelegateArgument argument2 = runtimeDelegateArguments[i];
Argument argument3 = null;
string name = argument2.Name;
if (this.DelegateArguments.TryGetValue(name, out argument3))
{
if (argument3.Direction != argument2.Direction)
{
metadata.AddValidationError(System.Activities.SR.DelegateParameterDirectionalityMismatch(name, argument3.Direction, argument2.Direction));
}
if (argument2.Direction == ArgumentDirection.In)
{
if (!TypeHelper.AreTypesCompatible(argument3.ArgumentType, argument2.Type))
{
metadata.AddValidationError(System.Activities.SR.DelegateInArgumentTypeMismatch(name, argument2.Type, argument3.ArgumentType));
}
}
else if (!TypeHelper.AreTypesCompatible(argument2.Type, argument3.ArgumentType))
{
metadata.AddValidationError(System.Activities.SR.DelegateOutArgumentTypeMismatch(name, argument2.Type, argument3.ArgumentType));
}
}
else
{
metadata.AddValidationError(System.Activities.SR.InputParametersMissing(argument2.Name));
}
if (!this.hasOutputArguments && ArgumentDirectionHelper.IsOut(argument2.Direction))
{
this.hasOutputArguments = true;
}
}
}
}
示例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)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
RuntimeArgument argument = new RuntimeArgument("Message", typeof(string), ArgumentDirection.In);
metadata.Bind(this.Message, argument);
arguments.Add(argument);
RuntimeArgument argument2 = new RuntimeArgument("IsWarning", typeof(bool), ArgumentDirection.In, false);
metadata.Bind(this.IsWarning, argument2);
arguments.Add(argument2);
RuntimeArgument argument3 = new RuntimeArgument("PropertyName", typeof(string), ArgumentDirection.In, false);
metadata.Bind(this.PropertyName, argument3);
arguments.Add(argument3);
metadata.SetArgumentsCollection(arguments);
}
示例11: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
RuntimeArgument argument = new RuntimeArgument("Reason", typeof(string), ArgumentDirection.In, false);
metadata.Bind(this.Reason, argument);
RuntimeArgument argument2 = new RuntimeArgument("Exception", typeof(System.Exception), ArgumentDirection.In, false);
metadata.Bind(this.Exception, argument2);
arguments.Add(argument);
arguments.Add(argument2);
metadata.SetArgumentsCollection(arguments);
if (((this.Reason == null) || this.Reason.IsEmpty) && ((this.Exception == null) || this.Exception.IsEmpty))
{
metadata.AddValidationError(System.Activities.SR.OneOfTwoPropertiesMustBeSet("Reason", "Exception", "TerminateWorkflow", base.DisplayName));
}
}
示例12: 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);
}
示例13: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument activityArgument = new RuntimeArgument("Activity", typeof(InvokeDelegate), ArgumentDirection.In, true);
metadata.Bind(this.Activity, activityArgument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { activityArgument });
metadata.AddImplementationChild(this.ShowWarning);
metadata.AddImplementationChild(this.ShowError);
metadata.AddImplementationVariable(this.WarningMessageVariable);
metadata.AddImplementationVariable(this.ErrorMessageVariable);
}
示例14: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
RuntimeArgument targetArgument = new RuntimeArgument("Target", typeof(CompensationToken), ArgumentDirection.In);
metadata.Bind(this.Target, targetArgument);
metadata.SetArgumentsCollection(new Collection<RuntimeArgument> { targetArgument });
}
示例15: 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);
}