2 // Mono.ILASM.ExternTypeRefInst
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2004 Novell, Inc (http://www.novell.com)
12 using System
.Collections
;
14 namespace Mono
.ILASM
{
16 public class ExternTypeRefInst
: ITypeRef
{
18 private ExternTypeRef type_ref
;
19 private PEAPI
.Type type
;
20 private bool is_valuetypeinst
;
21 private bool is_resolved
;
23 public ExternTypeRefInst (ExternTypeRef type_ref
, bool is_valuetypeinst
)
25 this.type_ref
= type_ref
;
26 this.is_valuetypeinst
= is_valuetypeinst
;
31 public PEAPI
.Type PeapiType
{
35 public string FullName
{
36 get { return type_ref.FullName; }
40 public string SigMod
{
41 get { return type_ref.SigMod; }
42 set { type_ref.SigMod = value; }
46 public bool IsPinned
{
47 get { return type_ref.IsPinned; }
51 get { return type_ref.IsRef; }
55 get { return type_ref.IsArray; }
58 public bool UseTypeSpec
{
59 get { return type_ref.UseTypeSpec; }
62 public ExternTypeRefInst
Clone ()
64 return new ExternTypeRefInst (type_ref
.Clone (), is_valuetypeinst
);
67 public void MakeArray ()
69 type_ref
.MakeArray ();
72 public void MakeBoundArray (ArrayList bounds
)
74 type_ref
.MakeBoundArray (bounds
);
77 public void MakeManagedPointer ()
79 type_ref
.MakeManagedPointer ();
82 public void MakeUnmanagedPointer ()
84 type_ref
.MakeUnmanagedPointer ();
87 public void MakeCustomModified (CodeGen code_gen
,
88 PEAPI
.CustomModifier modifier
, IClassRef klass
)
90 type_ref
.MakeCustomModified (code_gen
, modifier
, klass
);
93 public void MakePinned ()
95 type_ref
.MakePinned ();
98 public void MakeValueClass ()
100 type_ref
.MakeValueClass ();
103 public void Resolve (CodeGen code_gen
)
108 type_ref
.Resolve (code_gen
);
109 type
= new PEAPI
.ClassRefInst (type_ref
.PeapiType
, is_valuetypeinst
);
114 public IMethodRef
GetMethodRef (ITypeRef ret_type
, PEAPI
.CallConv call_conv
,
115 string name
, ITypeRef
[] param
)
117 return new TypeSpecMethodRef (this, ret_type
, call_conv
, name
, param
);
120 public IFieldRef
GetFieldRef (ITypeRef ret_type
, string name
)
122 return new TypeSpecFieldRef (this, ret_type
, name
);