Class Property<T, TValue>
Provides typed access to instance property declared in type T.
Implements
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public sealed class Property<T, TValue> : PropertyBase<TValue>, IEquatable<PropertyInfo>, IProperty<T, TValue>, IProperty, IMember<PropertyInfo>, ICustomAttributeProvider
Type Parameters
| Name | Description |
|---|---|
| T | Declaring type. |
| TValue | Type of property. |
Properties
| Improve this Doc View SourceGetMethod
Gets property getter.
Declaration
public Method<MemberGetter<T, TValue>> GetMethod { get; }
Property Value
| Type | Description |
|---|---|
| Method<MemberGetter<T, TValue>> |
Item[T]
Gets or sets property value.
Declaration
public TValue this[in T this] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| T | this |
|
Property Value
| Type | Description |
|---|---|
| TValue | Property value. |
SetMethod
Gets property setter.
Declaration
public Method<MemberSetter<T, TValue>> SetMethod { get; }
Property Value
| Type | Description |
|---|---|
| Method<MemberSetter<T, TValue>> |
Methods
| Improve this Doc View SourceGetValue(Object, out TValue)
Returns the value of the property supported by a given object.
Declaration
public override bool GetValue(object obj, out TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be returned. |
| TValue | value | An object containing the value of the property reflected by this instance. |
Returns
| Type | Description |
|---|---|
| Boolean | true, if property value is obtained successfully; otherwise, false. |
Overrides
SetValue(Object, TValue)
Sets the value of the property supported by the given object.
Declaration
public override bool SetValue(object obj, TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be set. |
| TValue | value | The value to assign to the property. |
Returns
| Type | Description |
|---|---|
| Boolean | true, if property value is modified successfully; otherwise, false. |
Overrides
Operators
| Improve this Doc View SourceImplicit(Property<T, TValue> to MemberGetter<T, TValue>)
Obtains property getter in the form of the delegate instance.
Declaration
public static implicit operator MemberGetter<T, TValue>(Property<T, TValue> property)
Parameters
| Type | Name | Description |
|---|---|---|
| Property<T, TValue> | property | The reflected property. |
Returns
| Type | Description |
|---|---|
| MemberGetter<T, TValue> |
Implicit(Property<T, TValue> to MemberSetter<T, TValue>)
Obtains property setter in the form of the delegate instance.
Declaration
public static implicit operator MemberSetter<T, TValue>(Property<T, TValue> property)
Parameters
| Type | Name | Description |
|---|---|---|
| Property<T, TValue> | property | The reflected property. |
Returns
| Type | Description |
|---|---|
| MemberSetter<T, TValue> |