CodeDomSerializerBase.GetSerializer Method (IDesignerSerializationManager, Object)

 

Locates a serializer for the given object value.

Namespace:   System.ComponentModel.Design.Serialization
Assembly:  System.Design (in System.Design.dll)

protected CodeDomSerializer GetSerializer(
	IDesignerSerializationManager manager,
	object value
)

Parameters

manager
Type: System.ComponentModel.Design.Serialization.IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

value
Type: System.Object

The object specifying the serializer to retrieve.

Return Value

Type: System.ComponentModel.Design.Serialization.CodeDomSerializer

A CodeDomSerializer that is appropriate for value.

Exception Condition
ArgumentNullException

manager or value is null.

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.

.NET Framework
Available since 2.0
Return to top
Show: