This documentation is archived and is not being maintained.

DesignerSerializerAttribute Class

Indicates a serializer for the serialization manager to use to serialize the values of the type this attribute is applied to. This class cannot be inherited.

For a list of all members of this type, see DesignerSerializerAttribute Members.


[Visual Basic]
<AttributeUsage(AttributeTargets.Class Or _
NotInheritable Public Class DesignerSerializerAttribute
   Inherits Attribute
[AttributeUsage(AttributeTargets.Class |
public sealed class DesignerSerializerAttribute : Attribute
[AttributeUsage(AttributeTargets::Class |
public __gc __sealed class DesignerSerializerAttribute : public
   AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)
class DesignerSerializerAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


DesignerSerializerAttribute provides a way to indicate to the designer serialization manager that a specific type of serializer should be used when serializing the values of an object. This allows you to specify a serializer that is capable of serializing a custom type, for instance. Place this attribute on a class to indicate the serialization object to use when serializing the class.


[Visual Basic, C#, C++] The following code uses a DesignerSerializerAttribute to associate an example serializer with an example component.

[Visual Basic] 
<DesignerSerializerAttribute(GetType(ExampleSerializer), GetType(CodeDomSerializer))> _
 Public Class ExampleControl
    Inherits System.Windows.Forms.UserControl

    Public Sub New()
    End Sub
End Class   

[DesignerSerializerAttribute(typeof(ExampleSerializer), typeof(CodeDomSerializer))]
public class ExampleControl : System.Windows.Forms.UserControl
    public ExampleControl()


[DesignerSerializerAttribute(__typeof(ExampleSerializer), __typeof(CodeDomSerializer))]
public __gc class ExampleControl : public UserControl {


[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.ComponentModel.Design.Serialization

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

DesignerSerializerAttribute Members | System.ComponentModel.Design.Serialization Namespace | RootDesignerSerializerAttribute