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
-
AnyMemberInfo - Tipos derivados
-
FieldInfoMethodBasePropertyInfo
Propiedades
Métodos
GetCustomAttributes() : any[]
#
The custom attributes written on the member.
override ToString() : str
#
Miembros privados e internos (10)
readonly str name
#
readonly TypeDescriber describer
#
new(Type declaring, str name, i32 flags, TypeDescriber describer, i32 index)
#
What the describer's Attributes takes for this member (fields, methods and properties are numbered apart).
TypeDescriber Describer { get; }
#
Miembros heredados (4)
GetTypemétodo de AnyUndescribedmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
MemberInfo en Antril, descompilado a partir de su Larva HIR.
// 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);
}
}
}