final class · System.Reflection
ParameterInfo
public final class ParameterInfo
A parameter of a method or constructor.
- Kind
- final class
- Namespace
- System.Reflection
- Assembly
- System.Core
- Access
- public, final
- Source file
Reflection.ant
Inheritance
- Base classes
-
AnyParameterInfo
Properties
Methods
GetCustomAttributes() : any[]
#
The custom attributes written on the parameter ([Tag("n")] i32 n).
override ToString() : str
#
Private and internal members (5)
Inherited members (4)
GetTypemethod from AnyUndescribedmethod from AnyHashmethod from Anydestroymethod from Any
Source
ParameterInfo as Antril, decompiled from its Larva HIR.
// System.Reflection.ParameterInfo — System.Core (decompiled from Larva HIR)
import System;
into namespace System.Reflection
{
/// A parameter of a method or constructor.
public final class ParameterInfo
{
readonly str name;
readonly Type type;
readonly i32 position;
internal:
/// The method or constructor it belongs to (set when that is made).
MethodBase? member;
new(str name, Type type, i32 position)
{
this.name = name;
this.type = type;
this.position = position;
}
public:
/// The custom attributes written on the parameter (`[Tag("n")] i32 n`).
GetCustomAttributes() : any[]
{
if (member is MethodBase owner)
return owner.Describer.Attributes(4000000 + owner.Index * 256 + position);
return [];
}
GetCustomAttributes(Type attributeType) : any[] => Attributes.Of(GetCustomAttributes(), attributeType);
IsDefined(Type attributeType) : bool => GetCustomAttributes(attributeType).Length > 0;
override ToString() : str => type.FullName + " " + name;
str Name
{
get => name;
}
Type ParameterType
{
get => type;
}
i32 Position
{
get => position;
}
}
}