PostSharp5.0//API Reference/Post­Sharp.​Serialization Namespace/Import­Serializer­Attribute Class

ImportSerializerAttribute Class

Custom attribute that, when applied to a serializable type, specifies that the serializer of this type has a dependency on another serializer. The custom attribute can be applied at assembly level; it then applies to all serializable types in this assembly.
Inheritance Hierarchy
System.Object
  System.Attribute
    PostSharp.Serialization.ImportSerializerAttribute

Namespace:  PostSharp.Serialization
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.55.0 (5.0.55.0)
Syntax
C#
public sealed class ImportSerializerAttribute : Attribute

The ImportSerializerAttribute type exposes the following members.

Constructors
  NameDescription
Public methodImportSerializerAttribute
Initializes a new ImportSerializerAttribute.
Properties
  NameDescription
Public propertyObjectType
Gets the type of the object to be made serializable
Public propertySerializerType
Gets the serializer type.
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
Remarks

This custom attribute is useful to add serializers to types of third-party assemblies. For types whose source code you can modify, it is preferable to use PSerializableAttribute or SerializerAttribute.

See Also