C# Class Com.Aote.ObjectTools.CustomPropertyInfoHelper

自定义属性信息,包括属性名,属性类型,属性声明等。
Inheritance: System.Reflection.PropertyInfo
Show file Open project: DuBin1988/restv2

Public Properties

Property Type Description
ObjectType System.Type
_attributes List
_name string
_type System.Type

Private Properties

Property Type Description

Public Methods

Method Description
CustomPropertyInfoHelper ( string name, Type type, List attributes, Type objectType ) : System

采用属性名,类型,声明构造

CustomPropertyInfoHelper ( string name, Type type, Type objectType ) : System

采用属性名及类型构造

GetAccessors ( bool nonPublic ) : System.Reflection.MethodInfo[]
GetCustomAttributes ( Type attributeType, bool inherit ) : object[]
GetCustomAttributes ( bool inherit ) : object[]
GetGetMethod ( bool nonPublic ) : MethodInfo
GetIndexParameters ( ) : System.Reflection.ParameterInfo[]
GetSetMethod ( bool nonPublic ) : MethodInfo
GetValue ( object obj, BindingFlags invokeAttr, Binder binder, object index, System culture ) : object

读属性值,直接转为调用对象的GetPropertyValue

IsDefined ( Type attributeType, bool inherit ) : bool
SetValue ( object obj, object value, BindingFlags invokeAttr, Binder binder, object index, System culture ) : void

设置属性值,直接转为调用对象的SetPropertyValue方法。

Method Details

CustomPropertyInfoHelper() public method

采用属性名,类型,声明构造
public CustomPropertyInfoHelper ( string name, Type type, List attributes, Type objectType ) : System
name string 属性名
type System.Type 类型
attributes List 声明
objectType System.Type
return System

CustomPropertyInfoHelper() public method

采用属性名及类型构造
public CustomPropertyInfoHelper ( string name, Type type, Type objectType ) : System
name string 属性名
type System.Type 类型
objectType System.Type
return System

GetAccessors() public method

public GetAccessors ( bool nonPublic ) : System.Reflection.MethodInfo[]
nonPublic bool
return System.Reflection.MethodInfo[]

GetCustomAttributes() public method

public GetCustomAttributes ( Type attributeType, bool inherit ) : object[]
attributeType System.Type
inherit bool
return object[]

GetCustomAttributes() public method

public GetCustomAttributes ( bool inherit ) : object[]
inherit bool
return object[]

GetGetMethod() public method

public GetGetMethod ( bool nonPublic ) : MethodInfo
nonPublic bool
return System.Reflection.MethodInfo

GetIndexParameters() public method

public GetIndexParameters ( ) : System.Reflection.ParameterInfo[]
return System.Reflection.ParameterInfo[]

GetSetMethod() public method

public GetSetMethod ( bool nonPublic ) : MethodInfo
nonPublic bool
return System.Reflection.MethodInfo

GetValue() public method

读属性值,直接转为调用对象的GetPropertyValue
public GetValue ( object obj, BindingFlags invokeAttr, Binder binder, object index, System culture ) : object
obj object 要读取值的对象
invokeAttr BindingFlags 未知
binder System.Reflection.Binder 未知
index object 未知
culture System 未知
return object

IsDefined() public method

public IsDefined ( Type attributeType, bool inherit ) : bool
attributeType System.Type
inherit bool
return bool

SetValue() public method

设置属性值,直接转为调用对象的SetPropertyValue方法。
public SetValue ( object obj, object value, BindingFlags invokeAttr, Binder binder, object index, System culture ) : void
obj object 要设置值的对象
value object 设置的值
invokeAttr BindingFlags 未知
binder System.Reflection.Binder 未知
index object 未知
culture System 未知
return void

Property Details

ObjectType public property

public Type,System ObjectType
return System.Type

_attributes public property

属性声明
public List _attributes
return List

_name public property

属性名
public string _name
return string

_type public property

属性类型
public Type,System _type
return System.Type