GlobalObject.GetSerializer Method

Returns the checked serializer of the specified type for the global object.

Namespace:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

'宣言
Public Function GetSerializer ( _
    serializerType As Type _
) As Object
'使用
Dim instance As GlobalObject
Dim serializerType As Type
Dim returnValue As Object

returnValue = instance.GetSerializer(serializerType)
public Object GetSerializer(
    Type serializerType
)
public:
Object^ GetSerializer(
    Type^ serializerType
)
public function GetSerializer(
    serializerType : Type
) : Object

Parameters

  • serializerType
    Type: System.Type

    The type of serializer to retrieve.

Return Value

Type: System.Object

A serializer of the specified type if supported; otherwise, a null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

serializerType is a null reference (Nothing in Visual Basic).

InvalidOperationException

The non-a null reference (Nothing in Visual Basic) serializer retrieved is itself not serializable.

Remarks

The GetSerializer method safely wraps a call to the GetSerializerCore method, checking the parameter and the return value. GetSerializer ensures that the returned serializer must itself be serializable so that it is capable of marshaling across domain boundaries if required.

Permissions

See Also

Reference

GlobalObject Class

GlobalObject Members

Microsoft.VisualStudio.Shell.Design Namespace

GetSerializerCore