Compartir a través de


ScriptObject.InvokeSelf Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Invokes the current ScriptObject and assumes that it represents a JavaScript method.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

Syntax

'Declaration
Public Overridable Function InvokeSelf ( _
    ParamArray args As Object() _
) As Object
public virtual Object InvokeSelf(
    params Object[] args
)

Parameters

  • args
    Type: array<System.Object[]
    Parameters to be passed to the underlying JavaScript method.

Return Value

Type: System.Object
An object that represents the return value from the underlying JavaScript method.

Exceptions

Exception Condition
ArgumentNullException

name is nulla null reference (Nothing in Visual Basic).

ArgumentException

name is an empty string.

-or-

name contains an embedded null character (\0).

-or-

The method does not exist or is not scriptable.

InvalidOperationException

The current ScriptObject is not a method.

-or-

The underlying method invocation results in an error.

Remarks

The possible types for args follow the rules for passing managed types to JavaScript. The possible return values follow the rules for returning types from JavaScript to managed code using by-reference marshaling rules.

For more information, see Returning or Passing Managed Types to JavaScript.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.