Show / Hide Table of Contents

Class PropertyBase<TValue>

Represents non-indexer property.

Inheritance
Object
MemberInfo
PropertyInfo
PropertyBase<TValue>
Property<TValue>
Property<T, TValue>
Implements
IProperty
IMember<PropertyInfo>
ICustomAttributeProvider
IEquatable<PropertyInfo>
Inherited Members
PropertyInfo.GetAccessors()
PropertyInfo.GetGetMethod()
PropertyInfo.GetSetMethod()
PropertyInfo.GetValue(Object)
PropertyInfo.SetValue(Object, Object)
PropertyInfo.IsSpecialName
MemberInfo.HasSameMetadataDefinitionAs(MemberInfo)
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
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 Source

Attributes

Gets the attributes for this property.

Declaration
public override sealed PropertyAttributes Attributes { get; }
Property Value
Type Description
PropertyAttributes
Overrides
PropertyInfo.Attributes
| Improve this Doc View Source

CanRead

Gets a value indicating whether the property can be read.

Declaration
public override sealed bool CanRead { get; }
Property Value
Type Description
Boolean
Overrides
PropertyInfo.CanRead
| Improve this Doc View Source

CanWrite

Gets a value indicating whether the property can be written to.

Declaration
public override sealed bool CanWrite { get; }
Property Value
Type Description
Boolean
Overrides
PropertyInfo.CanWrite
| Improve this Doc View Source

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>
Overrides
MemberInfo.CustomAttributes
| Improve this Doc View Source

DeclaringType

Gets the class that declares this property.

Declaration
public override sealed Type DeclaringType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.DeclaringType
| Improve this Doc View Source

GetMethod

Gets the get accessor for this property.

Declaration
public override sealed MethodInfo GetMethod { get; }
Property Value
Type Description
MethodInfo
Overrides
PropertyInfo.GetMethod
| Improve this Doc View Source

MemberType

Always returns Property.

Declaration
public override sealed MemberTypes MemberType { get; }
Property Value
Type Description
MemberTypes
Overrides
PropertyInfo.MemberType
| Improve this Doc View Source

MetadataToken

Gets a value that identifies a metadata element.

Declaration
public override sealed int MetadataToken { get; }
Property Value
Type Description
Int32
Overrides
MemberInfo.MetadataToken
| Improve this Doc View Source

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
Overrides
MemberInfo.Module
| Improve this Doc View Source

Name

Gets name of the property.

Declaration
public override sealed string Name { get; }
Property Value
Type Description
String
Overrides
MemberInfo.Name
| Improve this Doc View Source

PropertyType

Gets the type of this property.

Declaration
public override sealed Type PropertyType { get; }
Property Value
Type Description
Type
Overrides
PropertyInfo.PropertyType
| Improve this Doc View Source

ReflectedType

Gets the class object that was used to obtain this instance.

Declaration
public override sealed Type ReflectedType { get; }
Property Value
Type Description
Type
Overrides
MemberInfo.ReflectedType
| Improve this Doc View Source

SetMethod

Gets the set accessor for this property.

Declaration
public override sealed MethodInfo SetMethod { get; }
Property Value
Type Description
MethodInfo
Overrides
PropertyInfo.SetMethod

Methods

| Improve this Doc View Source

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.

Overrides
PropertyInfo.Equals(Object)
| Improve this Doc View Source

Equals(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.

| Improve this Doc View Source

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
PropertyInfo.GetAccessors(Boolean)
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetConstantValue()
| Improve this Doc View Source

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.

Overrides
MemberInfo.GetCustomAttributes(Boolean)
| Improve this Doc View Source

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
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
MemberInfo.GetCustomAttributes(Type, Boolean)
| Improve this Doc View Source

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.

Overrides
MemberInfo.GetCustomAttributesData()
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetGetMethod(Boolean)
| Improve this Doc View Source

GetHashCode()

Computes hash code uniquely identifies the reflected property.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

The hash code of the property.

Overrides
PropertyInfo.GetHashCode()
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetIndexParameters()
| Improve this Doc View Source

GetOptionalCustomModifiers()

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
PropertyInfo.GetOptionalCustomModifiers()
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetRawConstantValue()
| Improve this Doc View Source

GetRequiredCustomModifiers()

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
PropertyInfo.GetRequiredCustomModifiers()
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetSetMethod(Boolean)
| Improve this Doc View Source

GetValue(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.

| Improve this Doc View Source

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
PropertyInfo.GetValue(Object, Object[])
| Improve this Doc View Source

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.

Overrides
PropertyInfo.GetValue(Object, BindingFlags, Binder, Object[], CultureInfo)
| Improve this Doc View Source

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
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 attributeType or any of its derived types is applied to this property; otherwise, false.

Overrides
MemberInfo.IsDefined(Type, Boolean)
| Improve this Doc View Source

SetValue(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.

| Improve this Doc View Source

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
PropertyInfo.SetValue(Object, Object, Object[])
| Improve this Doc View Source

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.

Overrides
PropertyInfo.SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo)
| Improve this Doc View Source

ToString()

Returns textual representation of this property.

Declaration
public override string ToString()
Returns
Type Description
String

The textual representation of this property.

Overrides
Object.ToString()

Explicit Interface Implementations

| Improve this Doc View Source

IMember<PropertyInfo>.RuntimeMember

Declaration
PropertyInfo IMember<PropertyInfo>.RuntimeMember { get; }
Returns
Type Description
PropertyInfo

Implements

IProperty
IMember<TMember>
System.Reflection.ICustomAttributeProvider
System.IEquatable<T>

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
CustomAttribute.IsDefined<TAttribute>(ICustomAttributeProvider, Boolean)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX