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.

Tipo
base class
Espacio de nombres
System.Reflection
Ensamblado
System.Core
Acceso
public, abstract
Archivo fuente
Reflection.ant

Herencia

Clases base
Any MemberInfo
Tipos derivados
FieldInfo MethodBase PropertyInfo

Propiedades

str Name { get; }
#

read-only

Type DeclaringType { get; }
#

read-only

bool IsPublic { get; }
#

read-only

bool IsStatic { get; }
#

read-only

Métodos

GetCustomAttributes() : any[]
#

The custom attributes written on the member.

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

override

Miembros privados e internos (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

Miembros heredados (4)

Código fuente

MemberInfo en Antril, descompilado a partir de su 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