Share via


KnownTypeAttribute.MethodName Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Namespace:  System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

Syntax

'Declaration
Public ReadOnly Property MethodName As String
public string MethodName { get; }

Property Value

Type: System.String
The name of the method on the type defined by the KnownTypeAttribute class.

Remarks

The method must exist on the class or structure that the KnownTypeAttribute is applied to, must be static, must accept no parameters, and must return an instance of any type that implements the generic IEnumerable<T> interface, such as the Collection<T> class, or an array of Type objects. The method is called once for each application domain when the data contract is loaded for the type.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

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