mono\mcs\class\corlib\System.Reflection\MonoField.cs
[StructLayout (LayoutKind.Sequential)]
internal class MonoField : RtFieldInfo {internal IntPtr klass;
internal RuntimeFieldHandle fhandle;
string name;
Type type;
FieldAttributes attrs;
public override FieldAttributes Attributes {
get {
return attrs;
}
}
public override RuntimeFieldHandle FieldHandle {
get {
return fhandle;
}
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern Type ResolveType ();
public override Type FieldType {
get {
if (type == null)
type = ResolveType ();
return type;
}
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern Type GetParentType (bool declaring);
public override Type ReflectedType {
get {
return GetParentType (false);
}
}
public override Type DeclaringType {
get {
return GetParentType (true);
}
}
public override string Name {
get {
return name;
}
}

本文深入解析了 MonoField 类的内部结构及其实现细节。MonoField 类作为 .NET 环境下 System.Reflection 命名空间的一部分,负责封装字段信息,并提供了一系列用于获取字段属性的方法。文中详细介绍了 MonoField 的各个成员变量及其作用,如字段类型、属性标志等。
7万+

被折叠的 条评论
为什么被折叠?



