InvokeMethod.MethodName Property

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

The name of the method to be invoked when the activity executes.

Namespace:   System.Activities.Statements
Assembly:  System.Activities (in System.Activities.dll)

public string MethodName { get; set; }

Property Value

Type: System.String

The method name.

The invoked method must be declared as public.

The following code sample demonstrates setting the MethodName property of an InvokeMethod activity. 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")
    }
},

.NET Framework
Available since 4.0
Return to top
Show: