base class · System.Reflection

MemberInfo

public base class MemberInfo

What every member has: its name, the type that declares it, its access, and where its describer keeps it.

Kind
base class
Namespace
System.Reflection
Assembly
System.Core
Access
public, abstract
Source file
Reflection.ant

Inheritance

Base classes
Any MemberInfo
Derived types
FieldInfo MethodBase PropertyInfo

Properties

str Name { get; }
#

read-only

Type DeclaringType { get; }
#

read-only

bool IsPublic { get; }
#

read-only

bool IsStatic { get; }
#

read-only

Methods

GetCustomAttributes() : any[]
#

The custom attributes written on the member.

GetCustomAttributes(Type attributeType) : any[]
#
IsDefined(Type attributeType) : bool
#
override ToString() : str
#

override

Private and internal members (10)

readonly str name
#

private

readonly Type declaring
#

private

readonly i32 flags
#

private

readonly TypeDescriber describer
#

private

readonly i32 index
#

private

new(Type declaring, str name, i32 flags, TypeDescriber describer, i32 index)
#

internal

virtual AttributeKey() : i32
#

internal virtual

What the describer's Attributes takes for this member (fields, methods and properties are numbered apart).

Has(i32 flag) : bool
#

internal

TypeDescriber Describer { get; }
#

internal read-only

i32 Index { get; }
#

internal read-only

Inherited members (4)

Source

MemberInfo as Antril, decompiled from its Larva HIR.

System.Reflection.MemberInfo.ant
// System.Reflection.MemberInfo — System.Core (decompiled from Larva HIR)

import System;

into namespace System.Reflection
{
	/// What every member has: its name, the type that declares it, its access, and where its describer keeps it.
	public base class MemberInfo
	{
		readonly str name;
		readonly Type declaring;
		readonly i32 flags;
		readonly TypeDescriber describer;
		readonly i32 index;

		internal:
			new(Type declaring, str name, i32 flags, TypeDescriber describer, i32 index)
			{
				this.declaring = declaring;
				this.name = name;
				this.flags = flags;
				this.describer = describer;
				this.index = index;
			}

			/// What the describer's Attributes takes for this member (fields, methods and properties are numbered apart).
			virtual AttributeKey() : i32 => index;

			Has(i32 flag) : bool => (flags & flag) != 0;

			TypeDescriber Describer
			{
				get => describer;
			}

			i32 Index
			{
				get => index;
			}

		public:
			/// The custom attributes written on the member.
			GetCustomAttributes() : any[] => describer.Attributes(AttributeKey());

			GetCustomAttributes(Type attributeType) : any[] => Attributes.Of(GetCustomAttributes(), attributeType);

			IsDefined(Type attributeType) : bool => GetCustomAttributes(attributeType).Length > 0;

			override ToString() : str => name;

			str Name
			{
				get => name;
			}

			Type DeclaringType
			{
				get => declaring;
			}

			bool IsPublic
			{
				get => Has(1);
			}

			bool IsStatic
			{
				get => Has(2);
			}
	}
}
Esc