ModuleServiceProxy.Invoke(String, Object[]) Method

Definition

Calls the specified method using the specified arguments.

protected:
 System::Object ^ Invoke(System::String ^ methodName, ... cli::array <System::Object ^> ^ parameters);
protected object Invoke (string methodName, params object[] parameters);
member this.Invoke : string * obj[] -> obj
Protected Function Invoke (methodName As String, ParamArray parameters As Object()) As Object

Parameters

methodName
String

The name of the method to invoke.

parameters
Object[]

An array of type Object that contains the parameters to pass to the method.

Returns

The return value from the delegate being invoked, or null if the delegate has no return value.

Examples

The following example shows the use of the Invoke method.

using System;
using System.Collections;
using Microsoft.Web.Management.Client;

namespace rxDemo {
    internal class DemoModuleServiceProxy : ModuleServiceProxy {
        public DemoModuleServiceProxy() : base() { } 

        public ArrayList GetSettings() {
            return (ArrayList)Invoke("GetSettings");
        } 

    }
}
internal class DemoPage : ModuleListPage {

    public DemoPage() : base() { }
    ModuleListPageGrouping _entryTypeGrouping;

// Invoke GetSettings from ModuleListPage derived class
private void GetSettingsMLP(object sender, DoWorkEventArgs e) {

    try {
        e.Result = _serviceProxy.GetSettings();
    } catch (Exception ex) {
        DisplayExceptionString(ex);
    }
}

Remarks

Only .NET Framework types can be passed; arbitrary objects cannot be passed as a parameter. The number of parameters passed is arbitrary.

Applies to