本文整理汇总了C#中RuntimeArgument类的典型用法代码示例。如果您正苦于以下问题:C# RuntimeArgument类的具体用法?C# RuntimeArgument怎么用?C# RuntimeArgument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeArgument类属于命名空间,在下文中一共展示了RuntimeArgument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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 });
}
示例2: CacheMetadata
protected override void CacheMetadata(ActivityMetadata metadata)
{
if (string.IsNullOrEmpty(this.OperationName))
{
metadata.AddValidationError(System.ServiceModel.Activities.SR.MissingOperationName(base.DisplayName));
}
MessagingActivityHelper.ValidateCorrelationInitializer(metadata, this.correlationInitializers, false, base.DisplayName, this.OperationName);
MessagingActivityHelper.AddRuntimeArgument(this.CorrelatesWith, "CorrelatesWith", Constants.CorrelationHandleType, ArgumentDirection.In, metadata);
this.InternalContent.CacheMetadata(metadata, this, this.OperationName);
if (this.correlationInitializers != null)
{
for (int i = 0; i < this.correlationInitializers.Count; i++)
{
CorrelationInitializer initializer = this.correlationInitializers[i];
initializer.ArgumentName = "Parameter" + i;
RuntimeArgument argument = new RuntimeArgument(initializer.ArgumentName, Constants.CorrelationHandleType, ArgumentDirection.In);
metadata.Bind(initializer.CorrelationHandle, argument);
metadata.AddArgument(argument);
}
}
if (!metadata.HasViolations)
{
this.internalReceive = this.CreateInternalReceive();
this.InternalContent.ConfigureInternalReceive(this.internalReceive, out this.requestFormatter);
}
else
{
this.internalReceive = null;
this.requestFormatter = null;
}
}
示例3: 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
});
}
示例4: CacheMetadata
internal override void CacheMetadata(ActivityMetadata metadata, Activity owner, string operationName)
{
this.ShredParameters();
int index = 0;
foreach (Type type in this.argumentTypes)
{
if ((type == null) || (type == TypeHelper.VoidType))
{
metadata.AddValidationError(System.ServiceModel.Activities.SR.ArgumentCannotHaveNullOrVoidType(owner.DisplayName, this.argumentNames[index]));
}
if ((type == MessageDescription.TypeOfUntypedMessage) || MessageBuilder.IsMessageContract(type))
{
metadata.AddValidationError(System.ServiceModel.Activities.SR.ReceiveParametersContentDoesNotSupportMessage(owner.DisplayName, this.argumentNames[index]));
}
index++;
}
if (!metadata.HasViolations)
{
foreach (KeyValuePair<string, OutArgument> pair in this.Parameters)
{
RuntimeArgument argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, ArgumentDirection.Out);
metadata.Bind(pair.Value, argument);
metadata.AddArgument(argument);
}
}
}
示例5: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
// The Body introduces another layer of scope. Method metadata.AddImplementationChild
// (instead of metadata.AddChild) enable access to LoopVariable from the inner
// block scope of Body.
if (this.Body != null && this.Body.Handler != null)
{
this.invokeBody.Action = this.Body;
metadata.AddImplementationChild(this.invokeBody);
}
// Need to bind the arguments to the custom activity variables explicitly
// and then add them to the metadata.
RuntimeArgument startArg = new RuntimeArgument("Start", typeof(int), ArgumentDirection.In, true);
metadata.Bind(this.Start, startArg);
metadata.AddArgument(startArg);
RuntimeArgument stopArg = new RuntimeArgument("Stop", typeof(int), ArgumentDirection.In, true);
metadata.Bind(this.Stop, stopArg);
metadata.AddArgument(stopArg);
RuntimeArgument stepArg = new RuntimeArgument("Step", typeof(int), ArgumentDirection.In, true);
metadata.Bind(this.Step, stepArg);
metadata.AddArgument(stepArg);
// Register variables used in the custom activity.
metadata.AddImplementationVariable(this.loopVariable);
}
示例6: CacheMetadata
/// <summary>
/// The cache metadata.
/// </summary>
/// <param name="metadata">
/// The metadata.
/// </param>
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.RequireExtension<IMessagingStub>();
var parametersContent = this.Content as ReceiveParametersContent;
if (parametersContent != null)
{
foreach (var pair in parametersContent.Parameters)
{
var argument = new RuntimeArgument(pair.Key, pair.Value.ArgumentType, ArgumentDirection.Out);
metadata.Bind(pair.Value, argument);
metadata.AddArgument(argument);
}
}
var messageContent = this.Content as ReceiveMessageContent;
if (messageContent != null)
{
var runtimeArgumentType = (messageContent.Message == null) ? typeof(object) : messageContent.Message.ArgumentType;
var argument = new RuntimeArgument("Message", runtimeArgumentType, ArgumentDirection.Out);
metadata.Bind(messageContent.Message, argument);
metadata.AddArgument(argument);
}
// Note: Not adding other properties here as arguments
}
示例7: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
if (this.Result != null)
{
RuntimeArgument argument = new RuntimeArgument("Result", this.Result.ArgumentType, ArgumentDirection.In);
metadata.Bind(this.Result, argument);
metadata.AddArgument(argument);
}
if (this.parameters != null)
{
int num = 0;
foreach (InArgument argument2 in this.parameters)
{
RuntimeArgument argument3 = new RuntimeArgument("Parameter" + num++, argument2.ArgumentType, ArgumentDirection.In);
metadata.Bind(argument2, argument3);
metadata.AddArgument(argument3);
}
}
RuntimeArgument argument4 = new RuntimeArgument("Message", System.ServiceModel.Activities.Constants.MessageType, ArgumentDirection.Out, true);
metadata.Bind(this.Message, argument4);
metadata.AddArgument(argument4);
RuntimeArgument argument5 = new RuntimeArgument("CorrelatesWith", System.ServiceModel.Activities.Constants.CorrelationHandleType, ArgumentDirection.In);
metadata.Bind(this.CorrelatesWith, argument5);
metadata.AddArgument(argument5);
}
示例8: CacheMetadata
protected override void CacheMetadata(CodeActivityMetadata metadata)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
Type objectType = TypeHelper.ObjectType;
if (this.Value != null)
{
objectType = this.Value.ArgumentType;
}
RuntimeArgument argument = new RuntimeArgument("Value", objectType, ArgumentDirection.In, true);
metadata.Bind(this.Value, argument);
Type argumentType = TypeHelper.ObjectType;
if (this.To != null)
{
argumentType = this.To.ArgumentType;
}
RuntimeArgument argument2 = new RuntimeArgument("To", argumentType, ArgumentDirection.Out, true);
metadata.Bind(this.To, argument2);
arguments.Add(argument);
arguments.Add(argument2);
metadata.SetArgumentsCollection(arguments);
if (((this.Value != null) && (this.To != null)) && !TypeHelper.AreTypesCompatible(this.Value.ArgumentType, this.To.ArgumentType))
{
metadata.AddValidationError(System.Activities.SR.TypeMismatchForAssign(this.Value.ArgumentType, this.To.ArgumentType, base.DisplayName));
}
}
示例9: 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);
}
示例10: 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.AddArgument(arg = new RuntimeArgument("UseCache", typeof(bool), ArgumentDirection.In));
metadata.Bind(UseCache, arg);
metadata.AddChild(ItemCount);
metadata.AddImplementationVariable(cachedVectors);
metadata.AddImplementationVariable(strategyHasJustInited);
base.CacheMetadata(metadata);
}
示例11: 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);
}
示例12: CacheMetadata
protected override void CacheMetadata(CodeActivityMetadata metadata)
{
Collection<RuntimeArgument> arguments = new Collection<RuntimeArgument>();
Type objectType = TypeHelper.ObjectType;
if (this.TargetObject != null)
{
objectType = this.TargetObject.ArgumentType;
}
RuntimeArgument argument = new RuntimeArgument("TargetObject", objectType, ArgumentDirection.In);
metadata.Bind(this.TargetObject, argument);
arguments.Add(argument);
Type argumentType = TypeHelper.ObjectType;
if (this.Result != null)
{
argumentType = this.Result.ArgumentType;
}
this.resultArgument = new RuntimeArgument("Result", argumentType, ArgumentDirection.Out);
metadata.Bind(this.Result, this.resultArgument);
arguments.Add(this.resultArgument);
this.methodResolver = this.CreateMethodResolver();
this.methodResolver.DetermineMethodInfo(metadata, out this.methodExecutor);
this.methodResolver.RegisterParameters(arguments);
metadata.SetArgumentsCollection(arguments);
this.methodResolver.Trace();
if (this.methodExecutor != null)
{
this.methodExecutor.Trace(this);
}
}
示例13: CacheMetadata
protected override void CacheMetadata(NativeActivityMetadata metadata)
{
metadata.RequireExtension<ICountModel>();
var currentCountArg = new RuntimeArgument(
"CurrentCount", typeof(Int32), ArgumentDirection.In);
metadata.AddArgument(currentCountArg);
metadata.Bind(this.CurrentCount, currentCountArg);
}
示例14: 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);
}
示例15: MethodExecutor
public MethodExecutor(Activity invokingActivity, Type targetType, InArgument targetObject, Collection<Argument> parameters, RuntimeArgument returnObject)
{
this.invokingActivity = invokingActivity;
this.targetType = targetType;
this.targetObject = targetObject;
this.parameters = parameters;
this.returnObject = returnObject;
}