CodeDomSerializerBase.GetSerializer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Locates a serializer for the given object value or type.
Overloads
GetSerializer(IDesignerSerializationManager, Object) |
Locates a serializer for the given object value. |
GetSerializer(IDesignerSerializationManager, Type) |
Locates a serializer for the given type. |
GetSerializer(IDesignerSerializationManager, Object)
Locates a serializer for the given object value.
protected:
System::ComponentModel::Design::Serialization::CodeDomSerializer ^ GetSerializer(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::Object ^ value);
protected System.ComponentModel.Design.Serialization.CodeDomSerializer GetSerializer (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object value);
protected System.ComponentModel.Design.Serialization.CodeDomSerializer? GetSerializer (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object? value);
member this.GetSerializer : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * obj -> System.ComponentModel.Design.Serialization.CodeDomSerializer
Protected Function GetSerializer (manager As IDesignerSerializationManager, value As Object) As CodeDomSerializer
Parameters
- manager
- IDesignerSerializationManager
The IDesignerSerializationManager to use for serialization.
- value
- Object
The object specifying the serializer to retrieve.
Returns
A CodeDomSerializer that is appropriate for value
.
Exceptions
manager
or value
is null
.
Remarks
The GetSerializer method is an extension to the IDesignerSerializationManager.GetSerializer method. The IDesignerSerializationManager.GetSerializer method takes an object type, rather than an object value. If an external party had overridden metadata for a specific object through TypeDescriptor, that metadata override would not be seen by the IDesignerSerializationManager.GetSerializer method, which only takes a type. The GetSerializer method checks the metadata of the value and the value's type. If the two differ, GetSerializer will look to see if there is a custom designer serializer attribute on the value. If so, GetSerializer will attempt to use it. Otherwise, it will defer to IDesignerSerializationManager.GetSerializer.
See also
Applies to
GetSerializer(IDesignerSerializationManager, Type)
Locates a serializer for the given type.
protected:
System::ComponentModel::Design::Serialization::CodeDomSerializer ^ GetSerializer(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, Type ^ valueType);
protected System.ComponentModel.Design.Serialization.CodeDomSerializer GetSerializer (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, Type valueType);
protected System.ComponentModel.Design.Serialization.CodeDomSerializer? GetSerializer (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, Type valueType);
member this.GetSerializer : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * Type -> System.ComponentModel.Design.Serialization.CodeDomSerializer
Protected Function GetSerializer (manager As IDesignerSerializationManager, valueType As Type) As CodeDomSerializer
Parameters
- manager
- IDesignerSerializationManager
The IDesignerSerializationManager to use for serialization.
Returns
A CodeDomSerializer that is appropriate for valueType
.
Exceptions
manager
or valueType
is null
.
Remarks
The GetSerializer method is an extension to the IDesignerSerializationManager.GetSerializer method. The IDesignerSerializationManager.GetSerializer method takes an object type, rather than an object value.