Mon Nov 19 13:58:01 CET 2001 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / FieldBuilder.cs
1
2
3 //
4 // System.Reflection.Emit/FieldBuilder.cs
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.Reflection;
14 using System.Reflection.Emit;
15 using System.Globalization;
16 using System.Runtime.CompilerServices;
17
18 namespace System.Reflection.Emit {
19         public sealed class FieldBuilder : FieldInfo {
20                 private FieldAttributes attrs;
21                 private Type type;
22                 private String name;
23                 private object def_value;
24                 private int offset;
25                 private int table_idx;
26                 internal TypeBuilder typeb;
27
28                 internal FieldBuilder (TypeBuilder tb, string fieldName, Type type, FieldAttributes attributes) {
29                         attrs = attributes;
30                         name = fieldName;
31                         this.type = type;
32                         offset = -1;
33                         typeb = tb;
34                         table_idx = tb.get_next_table_index (0x04, true);
35                 }
36
37                 public override FieldAttributes Attributes {
38                         get {return attrs;}
39                 }
40                 public override Type DeclaringType {
41                         get {return typeb;}
42                 }
43                 public override RuntimeFieldHandle FieldHandle {
44                         get {return new RuntimeFieldHandle();}
45                 }
46                 public override Type FieldType {
47                         get {return type;}
48                 }
49                 public override string Name {
50                         get {return name;}
51                 }
52                 public override Type ReflectedType {
53                         get {return null;}
54                 }
55
56                 public override object[] GetCustomAttributes(bool inherit) {
57                         return null;
58                 }
59                 public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
60                         return null;
61                 }
62                 public FieldToken GetToken() {
63                         return new FieldToken (0x04000000 | table_idx);
64                 }
65                 public override object GetValue(object obj) {
66                         return null;
67                 }
68                 public override bool IsDefined( Type attributeType, bool inherit) {
69                         return false;
70                 }
71                 public void SetConstant( object defaultValue) {
72                         def_value = defaultValue;
73                 }
74                 public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
75                 }
76                 public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
77                 }
78                 public void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
79                 }
80                 public void SetOffset( int iOffset) {
81                         offset = iOffset;
82                 }
83                 public override void SetValue( object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
84                 }
85
86         }
87 }
88