System.Runtime.Serialization 4.0.0.0 System.Attribute System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.All, AllowMultiple=true, Inherited=true)

Apply the attribute to a type to indicate to the types that should be recognized when serializing or deserializing an instance of the type to which the attribute is applied. This attribute could also be recognized by other serializers that understand data contracts.

In your code, you can use the word KnownType instead of the longer KnownTypeAttribute.

You can either apply exactly one instance with the property set, or one or more instances with the property set.

Specifies types that should be recognized by the when serializing or deserializing a given type.

- Constructor
  4.0.0.0

  This constructor uses a method name that matches a method of the class. The method returns a of objects. During serialization or deserialization, the types found in the collection can be used within the root type to which the attribute is applied.

  Initializes a new instance of the class with the name of a method that returns an of known types.

  The name of the method that returns an of types used when serializing or deserializing data.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class with the specified type.

  The that is included as a known type when serializing or deserializing data.
- Property
  4.0.0.0
  System.String To be added.

  The method must exist on the class or structure that the is applied to, must be static, must accept no parameters, and must return an instance of any type that implements the generic interface, such as the class, or an array of objects.

  The method is called once per application domain when the data contract is loaded for the type.

  Gets the name of a method that will return a list of types that should be recognized during serialization or deserialization.

- Property
  4.0.0.0
  System.Type To be added. To be added.

  Gets the type that should be recognized during serialization or deserialization by the .