InvokeMethod.Parameters 屬性

定義

要叫用之方法的參數集合。

public:
 property System::Collections::ObjectModel::Collection<System::Activities::Argument ^> ^ Parameters { System::Collections::ObjectModel::Collection<System::Activities::Argument ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.Activities.Argument> Parameters { get; }
member this.Parameters : System.Collections.ObjectModel.Collection<System.Activities.Argument>
Public ReadOnly Property Parameters As Collection(Of Argument)

屬性值

參數集合。

範例

下列程式碼範例將示範如何設定 InvokeMethod 活動的 Parameters。 此範例來自 使用 InvokeMethod 活動 範例。

new InvokeMethod
{
    TargetObject = new InArgument<TestClass>(ctx => testClass),
    MethodName = "InstanceMethod",
    Parameters =
    {
        new InArgument<string>("My favorite number is"),
        new InArgument<int>(42),
        new InArgument<string>("first item of the param array"),
        new InArgument<string>("second item of the param array"),
        new InArgument<string>("third item of the param array")
    }
},

備註

將參數加入至集合時,加入順序必須與參數出現在方法簽章中的順序相同。 參數不能命名 TargetObject 為 或 Result

適用於