C# Class Jayrock.Json.Conversion.CustomTypeDescriptor

Provides an ICustomTypeDescriptor implementation on top of the public read/write fields and properties of a given type.
Inheritance: System.ComponentModel.ICustomTypeDescriptor
Afficher le fichier Open project: atifaziz/Jayrock Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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.

Method Details

CreateProperty() public static méthode

public static CreateProperty ( FieldInfo field ) : System.ComponentModel.PropertyDescriptor
field System.Reflection.FieldInfo
Résultat System.ComponentModel.PropertyDescriptor

CreateProperty() public static méthode

public static CreateProperty ( PropertyInfo property ) : System.ComponentModel.PropertyDescriptor
property System.Reflection.PropertyInfo
Résultat System.ComponentModel.PropertyDescriptor

CustomTypeDescriptor() public méthode

public CustomTypeDescriptor ( Type type ) : System
type System.Type
Résultat System

CustomTypeDescriptor() public méthode

public CustomTypeDescriptor ( Type type, MemberInfo members ) : System
type System.Type
members System.Reflection.MemberInfo
Résultat System

CustomTypeDescriptor() public méthode

public CustomTypeDescriptor ( Type type, MemberInfo members, string names ) : System
type System.Type
members System.Reflection.MemberInfo
names string
Résultat System

GetAttributes() public méthode

public GetAttributes ( ) : System.ComponentModel.AttributeCollection
Résultat System.ComponentModel.AttributeCollection

GetClassName() public méthode

public GetClassName ( ) : string
Résultat string

GetComponentName() public méthode

public GetComponentName ( ) : string
Résultat string

GetConverter() public méthode

public GetConverter ( ) : System.ComponentModel.TypeConverter
Résultat System.ComponentModel.TypeConverter

GetDefaultEvent() public méthode

public GetDefaultEvent ( ) : System.ComponentModel.EventDescriptor
Résultat System.ComponentModel.EventDescriptor

GetDefaultProperty() public méthode

public GetDefaultProperty ( ) : System.ComponentModel.PropertyDescriptor
Résultat System.ComponentModel.PropertyDescriptor

GetEditor() public méthode

public GetEditor ( Type editorBaseType ) : object
editorBaseType System.Type
Résultat object

GetEvents() public méthode

public GetEvents ( ) : System.ComponentModel.EventDescriptorCollection
Résultat System.ComponentModel.EventDescriptorCollection

GetEvents() public méthode

public GetEvents ( Attribute attributes ) : System.ComponentModel.EventDescriptorCollection
attributes System.Attribute
Résultat System.ComponentModel.EventDescriptorCollection

GetProperties() public méthode

public GetProperties ( ) : System.ComponentModel.PropertyDescriptorCollection
Résultat System.ComponentModel.PropertyDescriptorCollection

GetProperties() public méthode

public GetProperties ( Attribute attributes ) : System.ComponentModel.PropertyDescriptorCollection
attributes System.Attribute
Résultat System.ComponentModel.PropertyDescriptorCollection

GetPropertyOwner() public méthode

public GetPropertyOwner ( System.ComponentModel.PropertyDescriptor pd ) : object
pd System.ComponentModel.PropertyDescriptor
Résultat object

TryCreateForAnonymousClass() public static méthode

public static TryCreateForAnonymousClass ( Type type ) : CustomTypeDescriptor
type System.Type
Résultat CustomTypeDescriptor