Tue Dec 18 18:46:22 CET 2001 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection / MonoField.cs
1
2 //
3 // System.Reflection/MonoField.cs
4 // The class used to represent Fields from the mono runtime.
5 //
6 // Author:
7 //   Paolo Molaro (lupus@ximian.com)
8 //
9 // (C) 2001 Ximian, Inc.  http://www.ximian.com
10 //
11
12 using System;
13 using System.Globalization;
14 using System.Runtime.CompilerServices;
15 using System.Runtime.InteropServices;
16
17 namespace System.Reflection {
18         
19         internal struct MonoFieldInfo {
20                 public Type parent;
21                 public Type type;
22                 public String name;
23                 public FieldAttributes attrs;
24                 
25                 [MethodImplAttribute(MethodImplOptions.InternalCall)]
26                 internal static extern void get_field_info (MonoField field, out MonoFieldInfo info);
27         }
28
29         internal class MonoField : FieldInfo {
30                 internal IntPtr klass;
31                 internal RuntimeFieldHandle fhandle;
32                 
33                 public override FieldAttributes Attributes {
34                         get {
35                                 MonoFieldInfo info;
36                                 MonoFieldInfo.get_field_info (this, out info);
37                                 return info.attrs;
38                         }
39                 }
40                 public override RuntimeFieldHandle FieldHandle {
41                         get {return fhandle;}
42                 }
43
44                 public override Type FieldType { 
45                         get {
46                                 MonoFieldInfo info;
47                                 MonoFieldInfo.get_field_info (this, out info);
48                                 return info.type;
49                         }
50                 }
51
52                 public override Type ReflectedType {
53                         get {
54                                 MonoFieldInfo info;
55                                 MonoFieldInfo.get_field_info (this, out info);
56                                 return info.parent;
57                         }
58                 }
59                 public override Type DeclaringType {
60                         get {
61                                 MonoFieldInfo info;
62                                 MonoFieldInfo.get_field_info (this, out info);
63                                 return info.parent;
64                         }
65                 }
66                 public override string Name {
67                         get {
68                                 MonoFieldInfo info;
69                                 MonoFieldInfo.get_field_info (this, out info);
70                                 return info.name;
71                         }
72                 }
73
74                 public override bool IsDefined (Type attribute_type, bool inherit) {
75                         return false;
76                 }
77
78                 public override object[] GetCustomAttributes( bool inherit) {
79                         return null;
80                 }
81                 public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
82                         return null;
83                 }
84
85                 public override object GetValue(object obj) {
86                         throw new NotImplementedException ("Field::GetValue");
87                 }
88
89         }
90 }