共用方式為


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 集合包含了作業的方法簽章中的每個參數,再加上作業之傳回值的一個項目。

適用於