Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

KnownTypeAttribute Constructor (String^)

 

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

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

public:
KnownTypeAttribute(
	String^ methodName
)

Parameters

methodName
Type: System::String^

The name of the method that returns an IEnumerable of types used when serializing or deserializing data.

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

The following example uses the methodName parameter to identify a method in the type that contains an array of Type objects.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: