Open sandboxFocus

Class FieldOrPropertyInfo

Represents a reflection FieldInfo or a PropertyInfo.

Inheritance
FieldOrPropertyInfo
Namespace: Metalama.Framework.RunTime
Assembly: Metalama.Framework.dll
Syntax
public class FieldOrPropertyInfo : MemberInfo, ICustomAttributeProvider

Constructors

Name Description
FieldOrPropertyInfo(FieldInfo)

Initializes a new instance of the FieldOrPropertyInfo class that represents a field.

FieldOrPropertyInfo(PropertyInfo)

Initializes a new instance of the FieldOrPropertyInfo class that represents a property.

Properties

Name Description
AsField

Gets the FieldInfo if this represents a field, otherwise returns null.

AsPropertyOrIndexer

Gets the PropertyInfo if this represents a property, otherwise returns null.

DeclaringType
MemberType
Name
ReflectedType
UnderlyingMemberInfo

Gets the underlying MemberInfo (either a FieldInfo or PropertyInfo).

ValueType

Gets the type of the field or property value.

Methods

Name Description
GetCustomAttributes(bool)
GetCustomAttributes(Type, bool)
GetValue(object?)

Gets the value of the field or property from the specified object.

IsDefined(Type, bool)
SetValue(object?, object?)

Sets the value of the field or property on the specified object.

Extension Methods

See Also