Class PropertyBase<V>
Represents non-indexer property.
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public abstract class PropertyBase<V> : PropertyInfo, IProperty, IMember<PropertyInfo>, ICustomAttributeProvider, IEquatable<PropertyInfo>
Type Parameters
| Name | Description |
|---|---|
| V | Type of property value. |
Properties
| Improve this Doc View SourceAttributes
Gets the attributes for this property.
Declaration
public override sealed PropertyAttributes Attributes { get; }
Property Value
| Type | Description |
|---|---|
| PropertyAttributes |
CanRead
Gets a value indicating whether the property can be read.
Declaration
public override sealed bool CanRead { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
CanWrite
Gets a value indicating whether the property can be written to.
Declaration
public override sealed bool CanWrite { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
CustomAttributes
Gets a collection that contains this member's custom attributes.
Declaration
public override sealed IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<CustomAttributeData> |
DeclaringType
Gets the class that declares this property.
Declaration
public override sealed Type DeclaringType { get; }
Property Value
| Type | Description |
|---|---|
| DotNext.Reflection.Type |
GetMethod
Gets the get accessor for this property.
Declaration
public override sealed MethodInfo GetMethod { get; }
Property Value
| Type | Description |
|---|---|
| MethodInfo |
MemberType
Always returns
Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
| Type | Description |
|---|---|
| MemberTypes |
MetadataToken
Gets a value that identifies a metadata element.
Declaration
public override sealed int MetadataToken { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Module
Gets the module in which the type that declares the property represented by the current instance is defined.
Declaration
public override sealed Module Module { get; }
Property Value
| Type | Description |
|---|---|
| Module |
Name
Gets name of the property.
Declaration
public override sealed string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
PropertyType
Gets the type of this property.
Declaration
public override sealed Type PropertyType { get; }
Property Value
| Type | Description |
|---|---|
| DotNext.Reflection.Type |
ReflectedType
Gets the class object that was used to obtain this instance.
Declaration
public override sealed Type ReflectedType { get; }
Property Value
| Type | Description |
|---|---|
| DotNext.Reflection.Type |
SetMethod
Gets the set accessor for this property.
Declaration
public override sealed MethodInfo SetMethod { get; }
Property Value
| Type | Description |
|---|---|
| MethodInfo |
Methods
| Improve this Doc View SourceEquals(PropertyInfo)
Determines whether this property is equal to the given property.
Declaration
public bool Equals(PropertyInfo other)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyInfo | other | Other property to compare. |
Returns
| Type | Description |
|---|---|
| Boolean | true if this object reflects the same property as the specified object; otherwise, false. |
Equals(Object)
Determines whether this property is equal to the given property.
Declaration
public override bool Equals(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | other | Other property to compare. |
Returns
| Type | Description |
|---|---|
| Boolean | true if this object reflects the same property as the specified object; otherwise, false. |
GetAccessors(Boolean)
Returns an array whose elements reflect the public and, if specified, non-public get and set accessors of the property reflected by the current instance.
Declaration
public override sealed MethodInfo[] GetAccessors(bool nonPublic)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | nonPublic | Indicates whether non-public methods should be returned in the returned array. |
Returns
| Type | Description |
|---|---|
| MethodInfo[] | An array whose elements reflect the get and set accessors of the property reflected by the current instance. |
GetConstantValue()
Returns a literal value associated with the property by a compiler.
Declaration
public override sealed object GetConstantValue()
Returns
| Type | Description |
|---|---|
| Object | The literal value associated with the property. |
GetCustomAttributes(Type, Boolean)
Returns an array of all custom attributes applied to this property.
Declaration
public override sealed object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
| Type | Name | Description |
|---|---|---|
| DotNext.Reflection.Type | attributeType | The type of attribute to search for. Only attributes that are assignable to this type are returned. |
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. |
Returns
| Type | Description |
|---|---|
| Object[] | An array that contains all the custom attributes applied to this property. |
GetCustomAttributes(Boolean)
Returns an array of all custom attributes applied to this property.
Declaration
public override sealed object[] GetCustomAttributes(bool inherit)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. |
Returns
| Type | Description |
|---|---|
| Object[] | An array that contains all the custom attributes applied to this property. |
GetCustomAttributesData()
Returns a list of custom attributes that have been applied to the target property.
Declaration
public override sealed IList<CustomAttributeData> GetCustomAttributesData()
Returns
| Type | Description |
|---|---|
| IList<CustomAttributeData> | The data about the attributes that have been applied to the target property. |
GetGetMethod(Boolean)
Returns the public or non-public get accessor for this property.
Declaration
public override sealed MethodInfo GetGetMethod(bool nonPublic)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | nonPublic | Indicates whether a non-public get accessor should be returned. |
Returns
| Type | Description |
|---|---|
| MethodInfo | The object representing the get accessor for this property. |
GetHashCode()
Computes hash code uniquely identifies the reflected property.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | The hash code of the property. |
GetIndexParameters()
Returns an array of all the index parameters for the property.
Declaration
public override sealed ParameterInfo[] GetIndexParameters()
Returns
| Type | Description |
|---|---|
| ParameterInfo[] | An array containing the parameters for the indexes. |
GetOptionalCustomModifiers()
Returns an array of types representing the optional custom modifiers of the property.
Declaration
public override sealed Type[] GetOptionalCustomModifiers()
Returns
| Type | Description |
|---|---|
| DotNext.Reflection.Type[] | An array of objects that identify the optional custom modifiers of the current property |
GetRawConstantValue()
Returns a literal value associated with the property by a compiler.
Declaration
public override sealed object GetRawConstantValue()
Returns
| Type | Description |
|---|---|
| Object | An object that contains the literal value associated with the property. |
GetRequiredCustomModifiers()
Returns an array of types representing the required custom modifiers of the property.
Declaration
public override sealed Type[] GetRequiredCustomModifiers()
Returns
| Type | Description |
|---|---|
| DotNext.Reflection.Type[] | An array of objects that identify the required custom modifiers of the current property. |
GetSetMethod(Boolean)
Gets the set accessor for this property.
Declaration
public override sealed MethodInfo GetSetMethod(bool nonPublic)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | nonPublic | Indicates whether a non-public set accessor should be returned. |
Returns
| Type | Description |
|---|---|
| MethodInfo | The object representing the set accessor for this property. |
GetValue(Object, out V)
Returns the value of the property supported by a given object.
Declaration
public abstract bool GetValue(object obj, out V value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be returned. |
| V | 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. |
GetValue(Object, BindingFlags, Binder, Object[], CultureInfo)
Returns the property value of a specified object with index values for indexed properties.
Declaration
public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be returned. |
| BindingFlags | invokeAttr | Specifies the type of binding. |
| Binder | binder | Defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. |
| Object[] | index | Index values for indexed properties. |
| CultureInfo | culture | Used to govern the coercion of types. |
Returns
| Type | Description |
|---|---|
| Object | The property value of the specified object. |
GetValue(Object, Object[])
Returns the property value of a specified object with index values for indexed properties.
Declaration
public override object GetValue(object obj, object[] index)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be returned. |
| Object[] | index | Index values for indexed properties. |
Returns
| Type | Description |
|---|---|
| Object | The property value of the specified object. |
IsDefined(Type, Boolean)
Determines whether one or more attributes of the specified type or of its derived types is applied to this property.
Declaration
public override sealed bool IsDefined(Type attributeType, bool inherit)
Parameters
| Type | Name | Description |
|---|---|---|
| DotNext.Reflection.Type | attributeType | The type of custom attribute to search for. The search includes derived types. |
| Boolean | inherit | true to search this member's inheritance chain to find the attributes; otherwise, false. |
Returns
| Type | Description |
|---|---|
| Boolean | true if one or more instances of |
SetValue(Object, V)
Sets the value of the property supported by the given object.
Declaration
public abstract bool SetValue(object obj, V value)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be set. |
| V | value | The value to assign to the property. |
Returns
| Type | Description |
|---|---|
| Boolean | true, if property value is modified successfully; otherwise, false. |
SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo)
Sets the property value for a specified object that has the specified binding, index, and culture-specific information.
Declaration
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be set. |
| Object | value | The new value of the property. |
| BindingFlags | invokeAttr | Specifies the type of binding. |
| Binder | binder | Defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. |
| Object[] | index | Index values for indexed properties. |
| CultureInfo | culture | Used to govern the coercion of types. |
SetValue(Object, Object, Object[])
Sets the property value of a specified object with optional index values for index properties.
Declaration
public override void SetValue(object obj, object value, object[] index)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object whose property value will be set. |
| Object | value | The new property value. |
| Object[] | index | The property value of the specified object. |
ToString()
Returns textual representation of this property.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | The textual representation of this property. |
Explicit Interface Implementations
| Improve this Doc View SourceIMember<PropertyInfo>.RuntimeMember
Declaration
PropertyInfo IMember<PropertyInfo>.RuntimeMember { get; }
Returns
| Type | Description |
|---|---|
| PropertyInfo |