C# Класс Jayrock.Json.Conversion.CustomTypeDescriptor

Provides an ICustomTypeDescriptor implementation on top of the public read/write fields and properties of a given type.
Наследование: System.ComponentModel.ICustomTypeDescriptor
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateProperty ( FieldInfo field ) : System.ComponentModel.PropertyDescriptor
CreateProperty ( PropertyInfo property ) : System.ComponentModel.PropertyDescriptor
CustomTypeDescriptor ( Type type ) : System
CustomTypeDescriptor ( Type type, MemberInfo members ) : System
CustomTypeDescriptor ( Type type, MemberInfo members, string names ) : System
GetAttributes ( ) : System.ComponentModel.AttributeCollection
GetClassName ( ) : string
GetComponentName ( ) : string
GetConverter ( ) : System.ComponentModel.TypeConverter
GetDefaultEvent ( ) : System.ComponentModel.EventDescriptor
GetDefaultProperty ( ) : System.ComponentModel.PropertyDescriptor
GetEditor ( Type editorBaseType ) : object
GetEvents ( ) : System.ComponentModel.EventDescriptorCollection
GetEvents ( Attribute attributes ) : System.ComponentModel.EventDescriptorCollection
GetProperties ( ) : System.ComponentModel.PropertyDescriptorCollection
GetProperties ( Attribute attributes ) : System.ComponentModel.PropertyDescriptorCollection
GetPropertyOwner ( System.ComponentModel.PropertyDescriptor pd ) : object
TryCreateForAnonymousClass ( Type type ) : CustomTypeDescriptor

Приватные методы

Метод Описание
AnyObjectByTypeName ( object objects, string typeNameSought ) : bool
CustomTypeDescriptor ( Type type, bool isAnonymousClass, MemberInfo members, string names ) : System
FindFirstObjectByTypeName ( object objects, string typeNameSought ) : object
LikeAnonymousClass ( Type type ) : bool

Forward-compatible way to see if the given type is an anonymous class (introduced since C# 3.0).

There is no sure shot method so we have rely to rely on a heuristic approach by looking for a few known characteristics. Note also that we take a "duck" approach to look for the CompilerGenerated attribute under .NET Framework 1.x, which does not seem like an appaling idea considering that the C# compiler does the same with ExtensionAttribute when it comes to extension methods.

Описание методов

CreateProperty() публичный статический Метод

public static CreateProperty ( FieldInfo field ) : System.ComponentModel.PropertyDescriptor
field System.Reflection.FieldInfo
Результат System.ComponentModel.PropertyDescriptor

CreateProperty() публичный статический Метод

public static CreateProperty ( PropertyInfo property ) : System.ComponentModel.PropertyDescriptor
property System.Reflection.PropertyInfo
Результат System.ComponentModel.PropertyDescriptor

CustomTypeDescriptor() публичный Метод

public CustomTypeDescriptor ( Type type ) : System
type System.Type
Результат System

CustomTypeDescriptor() публичный Метод

public CustomTypeDescriptor ( Type type, MemberInfo members ) : System
type System.Type
members System.Reflection.MemberInfo
Результат System

CustomTypeDescriptor() публичный Метод

public CustomTypeDescriptor ( Type type, MemberInfo members, string names ) : System
type System.Type
members System.Reflection.MemberInfo
names string
Результат System

GetAttributes() публичный Метод

public GetAttributes ( ) : System.ComponentModel.AttributeCollection
Результат System.ComponentModel.AttributeCollection

GetClassName() публичный Метод

public GetClassName ( ) : string
Результат string

GetComponentName() публичный Метод

public GetComponentName ( ) : string
Результат string

GetConverter() публичный Метод

public GetConverter ( ) : System.ComponentModel.TypeConverter
Результат System.ComponentModel.TypeConverter

GetDefaultEvent() публичный Метод

public GetDefaultEvent ( ) : System.ComponentModel.EventDescriptor
Результат System.ComponentModel.EventDescriptor

GetDefaultProperty() публичный Метод

public GetDefaultProperty ( ) : System.ComponentModel.PropertyDescriptor
Результат System.ComponentModel.PropertyDescriptor

GetEditor() публичный Метод

public GetEditor ( Type editorBaseType ) : object
editorBaseType System.Type
Результат object

GetEvents() публичный Метод

public GetEvents ( ) : System.ComponentModel.EventDescriptorCollection
Результат System.ComponentModel.EventDescriptorCollection

GetEvents() публичный Метод

public GetEvents ( Attribute attributes ) : System.ComponentModel.EventDescriptorCollection
attributes System.Attribute
Результат System.ComponentModel.EventDescriptorCollection

GetProperties() публичный Метод

public GetProperties ( ) : System.ComponentModel.PropertyDescriptorCollection
Результат System.ComponentModel.PropertyDescriptorCollection

GetProperties() публичный Метод

public GetProperties ( Attribute attributes ) : System.ComponentModel.PropertyDescriptorCollection
attributes System.Attribute
Результат System.ComponentModel.PropertyDescriptorCollection

GetPropertyOwner() публичный Метод

public GetPropertyOwner ( System.ComponentModel.PropertyDescriptor pd ) : object
pd System.ComponentModel.PropertyDescriptor
Результат object

TryCreateForAnonymousClass() публичный статический Метод

public static TryCreateForAnonymousClass ( Type type ) : CustomTypeDescriptor
type System.Type
Результат CustomTypeDescriptor