C# 클래스 Castle.Facilities.NHibernateIntegration.Util.ReflectionUtil

파일 보기 프로젝트 열기: hconceicao/Castle.Facilities.NHibernateIntegration3

공개 메소드들

메소드 설명
AddToArray ( FieldInfo field, object instance, object val ) : void

Adds to array.

ConvertTo ( string text, Type type ) : object

Converts from string to the type. Can covert from string, enums booleans, bytes, int32 and datetime

GetFieldValue ( object obj, FieldInfo field ) : object

Gets the field value from object, and return

GetFieldsDictionary ( object obj ) : IDictionary

Gets the fields names and values. The keys holds the names of the fields. The values hold the value of the field if it's a simple type, or the name of the field's type.

GetFieldsWithAttribute ( Type type, Type attribute ) : FieldInfoCollection

Gets all the fields from the object's type with specified attribute

GetFieldsWithOutAttributes ( Type type ) : FieldInfoCollection

Gets all the fields WITHOUT ANY of the specified attributes.

GetName ( object obj ) : string

Gets the name of an object. The name of the object is it's type name or the value of its Name property or field

GetNameOrEmpty ( object obj ) : string

Gets the value of a property or field name in the object. Or return empty string if there aren't any.

GetProperties ( object obj ) : System.Reflection.PropertyInfo[]

Gets the properties.

GetPropertiesDictionary ( object obj ) : IDictionary

Gets the readable (non indexed) properties names and values. The keys holds the names of the properties. The values are the values of the properties

GetPropertyValue ( PropertyInfo property, object obj ) : object

Gets the property value.

GetPropertyValue ( object obj, string property ) : object

Gets the property value.

GetValue ( object obj ) : string

Gets the value of the object, if the object is simple, the returned string is the object ToString(), otherwise, it's the object name (if it has one) or the object type.

HasValue ( object value ) : bool

An object has value if it's not null, an collection containing elements and a non-empty string

IsSimpleObject ( object obj ) : bool

Determines whether the object is simple. An object is simple if its type is simple or if it's null.

IsSimpleType ( Type type ) : bool

Determines whether type is simple enough to need just ToString() to show its state. (string,int, bool, enums are simple. Anything else is false.

RemoveFromArray ( FieldInfo field, object instance, int index ) : void

Removes from array.

SetName ( object obj, string name ) : void

Sets the name property or value of an object to the value of name. Does nothing if the object doesn't have any fields or properties named 'name'

비공개 메소드들

메소드 설명
GetField ( object obj, string field ) : FieldInfo

Gets the FieldInfo thus named

GetProperty ( object obj, string property ) : PropertyInfo

Gets the PropertyInfo thus named.

PropertyHasValue ( object obj, PropertyInfo prop ) : bool

Check if the property is not null and can be read and is no indexed. This is done to know if it can be read safely.

메소드 상세

AddToArray() 공개 정적인 메소드

Adds to array.
public static AddToArray ( FieldInfo field, object instance, object val ) : void
field System.Reflection.FieldInfo The field.
instance object The instance.
val object The val.
리턴 void

ConvertTo() 공개 정적인 메소드

Converts from string to the type. Can covert from string, enums booleans, bytes, int32 and datetime
public static ConvertTo ( string text, Type type ) : object
text string Text.
type System.Type Type.
리턴 object

GetFieldValue() 공개 정적인 메소드

Gets the field value from object, and return
public static GetFieldValue ( object obj, FieldInfo field ) : object
obj object
field System.Reflection.FieldInfo
리턴 object

GetFieldsDictionary() 공개 정적인 메소드

Gets the fields names and values. The keys holds the names of the fields. The values hold the value of the field if it's a simple type, or the name of the field's type.
public static GetFieldsDictionary ( object obj ) : IDictionary
obj object
리턴 IDictionary

GetFieldsWithAttribute() 공개 정적인 메소드

Gets all the fields from the object's type with specified attribute
public static GetFieldsWithAttribute ( Type type, Type attribute ) : FieldInfoCollection
type System.Type
attribute System.Type
리턴 FieldInfoCollection

GetFieldsWithOutAttributes() 공개 정적인 메소드

Gets all the fields WITHOUT ANY of the specified attributes.
public static GetFieldsWithOutAttributes ( Type type ) : FieldInfoCollection
type System.Type
리턴 FieldInfoCollection

GetName() 공개 정적인 메소드

Gets the name of an object. The name of the object is it's type name or the value of its Name property or field
public static GetName ( object obj ) : string
obj object
리턴 string

GetNameOrEmpty() 공개 정적인 메소드

Gets the value of a property or field name in the object. Or return empty string if there aren't any.
public static GetNameOrEmpty ( object obj ) : string
obj object
리턴 string

GetProperties() 공개 정적인 메소드

Gets the properties.
public static GetProperties ( object obj ) : System.Reflection.PropertyInfo[]
obj object The obj.
리턴 System.Reflection.PropertyInfo[]

GetPropertiesDictionary() 공개 정적인 메소드

Gets the readable (non indexed) properties names and values. The keys holds the names of the properties. The values are the values of the properties
public static GetPropertiesDictionary ( object obj ) : IDictionary
obj object
리턴 IDictionary

GetPropertyValue() 공개 정적인 메소드

Gets the property value.
public static GetPropertyValue ( PropertyInfo property, object obj ) : object
property System.Reflection.PropertyInfo The property.
obj object The obj.
리턴 object

GetPropertyValue() 공개 정적인 메소드

Gets the property value.
public static GetPropertyValue ( object obj, string property ) : object
obj object obj.
property string Property.
리턴 object

GetValue() 공개 정적인 메소드

Gets the value of the object, if the object is simple, the returned string is the object ToString(), otherwise, it's the object name (if it has one) or the object type.
public static GetValue ( object obj ) : string
obj object
리턴 string

HasValue() 공개 정적인 메소드

An object has value if it's not null, an collection containing elements and a non-empty string
public static HasValue ( object value ) : bool
value object
리턴 bool

IsSimpleObject() 공개 정적인 메소드

Determines whether the object is simple. An object is simple if its type is simple or if it's null.
public static IsSimpleObject ( object obj ) : bool
obj object
리턴 bool

IsSimpleType() 공개 정적인 메소드

Determines whether type is simple enough to need just ToString() to show its state. (string,int, bool, enums are simple. Anything else is false.
public static IsSimpleType ( Type type ) : bool
type System.Type
리턴 bool

RemoveFromArray() 공개 정적인 메소드

Removes from array.
public static RemoveFromArray ( FieldInfo field, object instance, int index ) : void
field System.Reflection.FieldInfo The field.
instance object The instance.
index int The index.
리턴 void

SetName() 공개 정적인 메소드

Sets the name property or value of an object to the value of name. Does nothing if the object doesn't have any fields or properties named 'name'
public static SetName ( object obj, string name ) : void
obj object
name string
리턴 void