Class Type<T>.Property<V>
Provides access to property declared in type T
.
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public static class Property<V> : object
Type Parameters
Name | Description |
---|---|
V | Type of property. |
Methods
| Improve this Doc View SourceGet(String, Boolean)
Reflects instance property.
Declaration
public static Property<T, V> 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, V> | Property field; or null, if property doesn't exist. |
GetGetter(String, Boolean)
Reflects instance property getter method.
Declaration
public static Method<MemberGetter<T, V>> 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, V>> | 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, V>> 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, V>> | The reflected setter method; or null, if setter method doesn't exist. |
GetStatic(String, Boolean)
Reflects static property.
Declaration
public static Property<V> 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<V> | Instance property; or null, if property doesn't exist. |
GetStaticGetter(String, Boolean)
Reflects static property getter method.
Declaration
public static Method<MemberGetter<V>> 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<V>> | 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<V>> 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<V>> | The reflected setter method; or null, if setter method doesn't exist. |
Require(String, Boolean)
Reflects instance property.
Declaration
public static Property<T, V> 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, V> | Instance property. |
Exceptions
Type | Condition |
---|---|
MissingPropertyException | Property doesn't exist. |
RequireGetter(String, Boolean)
Reflects instance property getter method.
Declaration
public static Method<MemberGetter<T, V>> 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, V>> | 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, V>> 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, V>> | The reflected setter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The setter doesn't exist. |
RequireStatic(String, Boolean)
Reflects static property.
Declaration
public static Property<V> 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<V> | Instance property. |
Exceptions
Type | Condition |
---|---|
MissingPropertyException | Property doesn't exist. |
RequireStaticGetter(String, Boolean)
Reflects static property setter method.
Declaration
public static Method<MemberGetter<V>> 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<V>> | 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<V>> 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<V>> | The reflected setter method. |
Exceptions
Type | Condition |
---|---|
MissingMethodException | The setter doesn't exist. |