Class Type<T>.Property<TValue>
Provides access to property declared in type T
.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public static class Property<TValue>
Type Parameters
Name | Description |
---|---|
TValue | Type of property. |
Methods
| Improve this Doc View SourceGet(String, Boolean)
Reflects instance property.
Declaration
public static Property<T, TValue> Get(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Property<T, TValue> | Property field; or null, if property doesn't exist. |
GetGetter(String, Boolean)
Reflects instance property getter method.
Declaration
public static Method<MemberGetter<T, TValue>> GetGetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberGetter<T, TValue>> | The reflected getter method; or null, if getter method doesn't exist. |
GetSetter(String, Boolean)
Reflects instance property setter method.
Declaration
public static Method<MemberSetter<T, TValue>> GetSetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberSetter<T, TValue>> | The reflected setter method; or null, if setter method doesn't exist. |
GetStatic(String, Boolean)
Reflects static property.
Declaration
public static Property<TValue> GetStatic(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of property. |
Boolean | nonPublic | True to reflect non-public property. |
Returns
Type | Description |
---|---|
Property<TValue> | Instance property; or null, if property doesn't exist. |
GetStaticGetter(String, Boolean)
Reflects static property getter method.
Declaration
public static Method<MemberGetter<TValue>> GetStaticGetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberGetter<TValue>> | The reflected getter method; or null, if getter method doesn't exist. |
GetStaticSetter(String, Boolean)
Reflects static property setter method.
Declaration
public static Method<MemberSetter<TValue>> GetStaticSetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberSetter<TValue>> | The reflected setter method; or null, if setter method doesn't exist. |
Require(String, Boolean)
Reflects instance property.
Declaration
public static Property<T, TValue> Require(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Property<T, TValue> | Instance property. |
Exceptions
Type | Condition |
---|---|
MissingPropertyException | Property doesn't exist. |
RequireGetter(String, Boolean)
Reflects instance property getter method.
Declaration
public static Method<MemberGetter<T, TValue>> RequireGetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberGetter<T, TValue>> | The reflected getter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The getter doesn't exist. |
RequireSetter(String, Boolean)
Reflects instance property setter method.
Declaration
public static Method<MemberSetter<T, TValue>> RequireSetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberSetter<T, TValue>> | The reflected setter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The setter doesn't exist. |
RequireStatic(String, Boolean)
Reflects static property.
Declaration
public static Property<TValue> RequireStatic(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of property. |
Boolean | nonPublic | True to reflect non-public property. |
Returns
Type | Description |
---|---|
Property<TValue> | Instance property. |
Exceptions
Type | Condition |
---|---|
MissingPropertyException | Property doesn't exist. |
RequireStaticGetter(String, Boolean)
Reflects static property setter method.
Declaration
public static Method<MemberGetter<TValue>> RequireStaticGetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberGetter<TValue>> | The reflected setter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The setter doesn't exist. |
RequireStaticSetter(String, Boolean)
Reflects static property setter method.
Declaration
public static Method<MemberSetter<TValue>> RequireStaticSetter(string propertyName, bool nonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | The name of the property. |
Boolean | nonPublic | true to reflect non-public property. |
Returns
Type | Description |
---|---|
Method<MemberSetter<TValue>> | The reflected setter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The setter doesn't exist. |