2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / codegen / FieldRef.cs
blob4b3acb557f59cd0ee7d61d68661e6b9ad8236715
1 //
2 // Mono.ILASM.FieldRef
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 FieldRef : IFieldRef {
18 private TypeRef owner;
19 private BaseTypeRef ret_type;
20 private string name;
22 private bool is_resolved;
23 private PEAPI.Field peapi_field;
25 public FieldRef (TypeRef owner, BaseTypeRef ret_type, string name)
27 this.owner = owner;
28 this.ret_type = ret_type;
29 this.name = name;
31 is_resolved = false;
34 public PEAPI.Field PeapiField {
35 get { return peapi_field; }
38 public void Resolve (CodeGen code_gen)
40 if (is_resolved)
41 return;
43 TypeDef owner_def = code_gen.TypeManager[owner.FullName];
44 peapi_field = owner_def.ResolveField (name, ret_type, code_gen);
46 is_resolved = true;