InvokeMethod.Parameters 属性

定义

要调用的方法的参数集合。The parameter collection of the method to be invoked.

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)

属性值

Collection<Argument>

参数集合。The parameter collection.

示例

下面的代码示例演示如何设置 InvokeMethod 活动的 Parameters。The following code sample demonstrates setting the Parameters of an InvokeMethod activity. 此示例来自 使用 InvokeMethod 活动 示例。This example is from the Using the InvokeMethod Activity sample.

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")
    }
},

注解

将参数添加到集合中的顺序必须与这些参数在方法签名中出现的顺序相同。The parameters must be added to the collection in the same order that they appear in the method signature. 参数不能命名为 TargetObjectResultParameters cannot be named TargetObject or Result.

适用于