Freigeben über


ScriptObject.ConvertTo Method (Type, Boolean)

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

Converts the current scriptable object to a specified type, with serialization support.

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

Syntax

'Declaration
Protected Friend Overridable Function ConvertTo ( _
    targetType As Type, _
    allowSerialization As Boolean _
) As Object
protected internal virtual Object ConvertTo(
    Type targetType,
    bool allowSerialization
)

Parameters

  • targetType
    Type: System.Type
    The type to convert the current scriptable object to.
  • allowSerialization
    Type: System.Boolean
    A flag which enables the current scriptable object to be serialized.

Return Value

Type: System.Object
An object of type targetType.

Exceptions

Exception Condition
ArgumentException

The conversion failed or is not supported.

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.