OperationInfo.Parameters 属性

定义

获取 OperationParameterInfo 对象的集合,表示操作所使用的参数定义。

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

属性值

OperationParameterInfoCollection

OperationParameterInfo 对象的集合,表示在由客户端调用时该操作所使用的参数定义。

示例

下面的示例演示如何访问 Parameters 属性。

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

注解

Parameters 集合将对该操作的方法签名中的每个参数包含一个元素,此外还包含一个表示操作返回值的元素。

适用于