다음을 통해 공유


JavaScriptConverter.SupportedTypes 속성

정의

파생 클래스에서 재정의되는 경우 지원되는 형식의 컬렉션을 가져옵니다.

public:
 abstract property System::Collections::Generic::IEnumerable<Type ^> ^ SupportedTypes { System::Collections::Generic::IEnumerable<Type ^> ^ get(); };
public abstract System.Collections.Generic.IEnumerable<Type> SupportedTypes { get; }
member this.SupportedTypes : seq<Type>
Public MustOverride ReadOnly Property SupportedTypes As IEnumerable(Of Type)

속성 값

변환기에서 지원하는 형식을 나타내는 개체 IEnumerable<T> 입니다.

예제

다음 예제에서는 파생된 클래스에서 속성을 재정의 SupportedTypes 하는 방법을 보여 있습니다. 이 예제에서 변환기는 형식만 ListItemCollection 지원합니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 JavaScriptConverter 일부입니다.

public override IEnumerable<Type> SupportedTypes
{
    //Define the ListItemCollection as a supported type.
    get { return new ReadOnlyCollection<Type>(new List<Type>(new Type[] { typeof(ListItemCollection) })); }
}
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

설명

이 속성은 SupportedTypes 변환기에서 지원하는 형식을 나열합니다. 런타임에 인스턴스는 JavaScriptSerializer 이 속성을 사용하여 해당 사용자 지정 변환기에서 관리되는 형식의 매핑을 결정합니다.

구현자 참고

SupportedTypes 는 항상 컬렉션을 반환해야 하며 컬렉션에 하나 이상의 항목이 포함되어야 합니다.

적용 대상