When overridden in a derived class, gets a collection of the supported types.
Syntax
CSharp
VisualBasic
Public MustOverride ReadOnly Property SupportedTypes As IEnumerable(Of Type)
ManagedCPlusPlus
JSharp
Value
Return Value
An object implementing IEnumerable that represents the types supported by the converter.
Remarks
The SupportedTypes property lists the types that are supported by the converter. At run time, a JavaScriptSerializer instance uses this property to determine the mapping of managed types to their corresponding custom converters.
Notes For Inheritors
SupportedTypes must always return a collection, and the collection must contain at least one entry.
Examples
The following example demonstrates how to override the SupportedTypes property in a derived class. In this example, the converter supports only the ListItemCollection type. This code example is part of a larger example provided for the JavaScriptConverter class.
App_Code
public override IEnumerable<Type> SupportedTypes
{
//Define the ListItemCollection as a supported type.
get { return new ReadOnlyCollection<Type>(new List<Type>(new Type[] { typeof(ListItemCollection) })); }
}
App_Code
Public Overrides ReadOnly Property SupportedTypes() As _
System.Collections.Generic.IEnumerable(Of System.Type)
Get
' Define the ListItemCollection as a supported type.
Return New ReadOnlyCollection(Of Type)(New List(Of Type) _
(New Type() {GetType(ListItemCollection)}))
End Get
End Property
Assembly: System.Web.Extensions (Module: System.Web.Extensions)