Прочитать на английском Изменить

Поделиться через


OperationInfo.Parameters Property

Definition

Gets a collection of OperationParameterInfo objects that represents the parameter definitions used by the operation.

C#
public System.Workflow.Activities.OperationParameterInfoCollection Parameters { get; }

Property Value

A collection of OperationParameterInfo objects that represents the parameter definitions used by the operation when called by a client.

Examples

The following example demonstrates how to access the Parameters property.

C#
ReceiveActivity receive = new ReceiveActivity();
OperationInfo info = new OperationInfo();
info.Name = "Echo";
OperationParameterInfo parameterInfo = new OperationParameterInfo();
parameterInfo.Attributes = ((System.Reflection.ParameterAttributes)((System.Reflection.ParameterAttributes.Out | System.Reflection.ParameterAttributes.Retval)));
parameterInfo.Name = "(ReturnValue)";
parameterInfo.ParameterType = typeof(string);
parameterInfo.Position = -1;
info.Parameters.Add(parameterInfo);
receive.ServiceOperationInfo = info;

Remarks

The Parameters collection will contain one element for each parameter in the method signature of the operation, plus one element for the return value of the operation.

Applies to

Продукт Версии
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1