2010-04-01 Jb Evain <jbevain@novell.com>
[mcs.git] / ilasm / codegen / TypeSpecFieldRef.cs
blob734c9f16224a212aef494d68b4c57f7a374d52fd
1 //
2 // Mono.ILASM.TypeSpecFieldRef
3 //
4 // Author(s):
5 // Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 JacksonHarper, All rights reserved
8 //
11 using System;
14 namespace Mono.ILASM {
16 public class TypeSpecFieldRef : IFieldRef {
18 private BaseTypeRef owner;
19 private BaseTypeRef type;
20 private string name;
22 private PEAPI.FieldRef peapi_field;
23 private bool is_resolved;
25 public TypeSpecFieldRef (BaseTypeRef owner, BaseTypeRef type, string name)
27 this.owner = owner;
28 this.type = 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 owner.Resolve (code_gen);
45 type.Resolve (code_gen);
46 peapi_field = code_gen.PEFile.AddFieldToTypeSpec (owner.PeapiType, name, type.PeapiType);
48 is_resolved = true;