2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / codegen / GlobalFieldRef.cs
blob2ab31a5834dddd0096d2c33183bc8c7f78c7e4f2
1 //
2 // Mono.ILASM.GlobalFieldRef
3 //
4 // Author(s):
5 // Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
11 using System;
13 namespace Mono.ILASM {
16 public class GlobalFieldRef : IFieldRef {
18 private BaseTypeRef ret_type;
19 private string name;
21 private PEAPI.Field peapi_field;
22 private bool is_resolved;
24 public GlobalFieldRef (BaseTypeRef ret_type, string name)
26 this.ret_type = ret_type;
27 this.name = name;
29 is_resolved = false;
32 public PEAPI.Field PeapiField {
33 get { return peapi_field; }
36 public void Resolve (CodeGen code_gen)
38 if (is_resolved)
39 return;
41 peapi_field = code_gen.ResolveField (name, ret_type.FullName);
43 is_resolved = true;