Class PropertyBase<TValue>
Represents non-indexer property.
Inheritance
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public abstract class PropertyBase<TValue> : PropertyInfo, IProperty, IMember<PropertyInfo>, ICustomAttributeProvider, IEquatable<PropertyInfo>
Type Parameters
Name | Description |
---|---|
TValue | 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 |
Overrides
| Improve this Doc View SourceCanRead
Gets a value indicating whether the property can be read.
Declaration
public override sealed bool CanRead { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceCanWrite
Gets a value indicating whether the property can be written to.
Declaration
public override sealed bool CanWrite { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceCustomAttributes
Gets a collection that contains this member's custom attributes.
Declaration
public override sealed IEnumerable<CustomAttributeData> CustomAttributes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<CustomAttributeData> |
Overrides
| Improve this Doc View SourceDeclaringType
Gets the class that declares this property.
Declaration
public override sealed Type DeclaringType { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
| Improve this Doc View SourceGetMethod
Gets the get accessor for this property.
Declaration
public override sealed MethodInfo GetMethod { get; }
Property Value
Type | Description |
---|---|
MethodInfo |
Overrides
| Improve this Doc View SourceMemberType
Always returns Property.
Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
Type | Description |
---|---|
MemberTypes |
Overrides
| Improve this Doc View SourceMetadataToken
Gets a value that identifies a metadata element.
Declaration
public override sealed int MetadataToken { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceModule
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 |
Overrides
| Improve this Doc View SourceName
Gets name of the property.
Declaration
public override sealed string Name { get; }
Property Value
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourcePropertyType
Gets the type of this property.
Declaration
public override sealed Type PropertyType { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
| Improve this Doc View SourceReflectedType
Gets the class object that was used to obtain this instance.
Declaration
public override sealed Type ReflectedType { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
| Improve this Doc View SourceSetMethod
Gets the set accessor for this property.
Declaration
public override sealed MethodInfo SetMethod { get; }
Property Value
Type | Description |
---|---|
MethodInfo |
Overrides
Methods
| Improve this Doc View SourceEquals(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. |
Overrides
| 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. |
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. |
Overrides
| Improve this Doc View SourceGetConstantValue()
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. |
Overrides
| Improve this Doc View SourceGetCustomAttributes(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. |
Overrides
| Improve this Doc View SourceGetCustomAttributes(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 |
---|---|---|
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. |
Overrides
| Improve this Doc View SourceGetCustomAttributesData()
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. |
Overrides
| Improve this Doc View SourceGetGetMethod(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. |
Overrides
| Improve this Doc View SourceGetHashCode()
Computes hash code uniquely identifies the reflected property.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code of the property. |
Overrides
| Improve this Doc View SourceGetIndexParameters()
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. |
Overrides
| Improve this Doc View SourceGetOptionalCustomModifiers()
Returns an array of types representing the optional custom modifiers of the property.
Declaration
public override sealed Type[] GetOptionalCustomModifiers()
Returns
Type | Description |
---|---|
Type[] | An array of objects that identify the optional custom modifiers of the current property. |
Overrides
| Improve this Doc View SourceGetRawConstantValue()
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. |
Overrides
| Improve this Doc View SourceGetRequiredCustomModifiers()
Returns an array of types representing the required custom modifiers of the property.
Declaration
public override sealed Type[] GetRequiredCustomModifiers()
Returns
Type | Description |
---|---|
Type[] | An array of objects that identify the required custom modifiers of the current property. |
Overrides
| Improve this Doc View SourceGetSetMethod(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. |
Overrides
| Improve this Doc View SourceGetValue(Object, out TValue)
Returns the value of the property supported by a given object.
Declaration
public abstract 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. |
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. |
Overrides
| Improve this Doc View SourceGetValue(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. |
Overrides
| Improve this Doc View SourceIsDefined(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 |
---|---|---|
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 |
Overrides
| Improve this Doc View SourceSetValue(Object, TValue)
Sets the value of the property supported by the given object.
Declaration
public abstract 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. |
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. |
Overrides
| Improve this Doc View SourceSetValue(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. |
Overrides
| Improve this Doc View SourceToString()
Returns textual representation of this property.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The textual representation of this property. |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIMember<PropertyInfo>.RuntimeMember
Declaration
PropertyInfo IMember<PropertyInfo>.RuntimeMember { get; }
Returns
Type | Description |
---|---|
PropertyInfo |