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.

System.Object
   System.Attribute
      System.ComponentModel.Design.Serialization.DesignerSerializerAttribute

[Visual Basic]
<AttributeUsage(AttributeTargets.Class Or _
   AttributeTargets.Interface)>
NotInheritable Public Class DesignerSerializerAttribute
   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Class |
   AttributeTargets.Interface)]
public sealed class DesignerSerializerAttribute : Attribute
[C++]
[AttributeUsage(AttributeTargets::Class |
   AttributeTargets::Interface)]
public __gc __sealed class DesignerSerializerAttribute : public
   Attribute
[JScript]
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.

Remarks

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.

Example

[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   

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

    }
}

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

    ExampleControl()
    {
    }
};

[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.

Requirements

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

Show: