Share via


InvokeMethod.MethodName 属性

定义

要在执行活动时调用的方法的名称。

public:
 property System::String ^ MethodName { System::String ^ get(); void set(System::String ^ value); };
public string MethodName { get; set; }
member this.MethodName : string with get, set
Public Property MethodName As String

属性值

方法名称。

示例

下面的代码示例演示如何设置 InvokeMethod 活动的 MethodName 属性。 此示例摘自 使用 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")
    }
},

注解

调用的方法必须声明为公共方法。

适用于