Click to Rate and Give Feedback
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Silverlight 3

Other versions are also available for the following:
.NET Framework Class Library for Silverlight
KnownTypeAttribute Class

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

Namespace:  System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)
Visual Basic (Declaration)
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Struct, Inherited := True,  _
    AllowMultiple := True)> _
Public NotInheritable Class KnownTypeAttribute _
    Inherits Attribute
Visual Basic (Usage)
Dim instance As KnownTypeAttribute
C#
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct, Inherited = true, 
    AllowMultiple = true)]
public sealed class KnownTypeAttribute : Attribute

Apply the KnownTypeAttribute attribute to a type to indicate to the DataContractSerializer 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.

NoteNote:

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

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

System..::.Object
  System..::.Attribute
    System.Runtime.Serialization..::.KnownTypeAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker