diff options
Diffstat (limited to 'mcs/ilasm/codegen/TypeSpecFieldRef.cs')
-rw-r--r-- | mcs/ilasm/codegen/TypeSpecFieldRef.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/mcs/ilasm/codegen/TypeSpecFieldRef.cs b/mcs/ilasm/codegen/TypeSpecFieldRef.cs new file mode 100644 index 00000000000..734c9f16224 --- /dev/null +++ b/mcs/ilasm/codegen/TypeSpecFieldRef.cs @@ -0,0 +1,54 @@ +// +// Mono.ILASM.TypeSpecFieldRef +// +// Author(s): +// Jackson Harper (Jackson@LatitudeGeo.com) +// +// (C) 2003 JacksonHarper, All rights reserved +// + + +using System; + + +namespace Mono.ILASM { + + public class TypeSpecFieldRef : IFieldRef { + + private BaseTypeRef owner; + private BaseTypeRef type; + private string name; + + private PEAPI.FieldRef peapi_field; + private bool is_resolved; + + public TypeSpecFieldRef (BaseTypeRef owner, BaseTypeRef type, string name) + { + this.owner = owner; + this.type = type; + this.name = name; + + is_resolved = false; + } + + public PEAPI.Field PeapiField { + get { return peapi_field; } + } + + public void Resolve (CodeGen code_gen) + { + if (is_resolved) + return; + + owner.Resolve (code_gen); + + type.Resolve (code_gen); + peapi_field = code_gen.PEFile.AddFieldToTypeSpec (owner.PeapiType, name, type.PeapiType); + + is_resolved = true; + } + + } + +} + |