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
)
member GetSerializer :
serializerType:Type -> Object
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, nulla null reference (Nothing in Visual Basic).
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | serializerType is nulla null reference (Nothing in Visual Basic). |
InvalidOperationException | The non-nulla 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.