Redigera

Dela via


OperationInfo.Parameters Property

Definition

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

public:
 property System::Workflow::Activities::OperationParameterInfoCollection ^ Parameters { System::Workflow::Activities::OperationParameterInfoCollection ^ get(); };
public System.Workflow.Activities.OperationParameterInfoCollection Parameters { get; }
member this.Parameters : System.Workflow.Activities.OperationParameterInfoCollection
Public ReadOnly Property Parameters As OperationParameterInfoCollection

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.

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;
Dim receive As New ReceiveActivity()
Dim info As New OperationInfo()
info.Name = "Echo"
Dim parameterInfo As New OperationParameterInfo()
parameterInfo.Attributes = (CType((System.Reflection.ParameterAttributes.Out Or System.Reflection.ParameterAttributes.Retval),  _
                            System.Reflection.ParameterAttributes))
parameterInfo.Name = "(ReturnValue)"
parameterInfo.ParameterType = GetType(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