2 // Mono.ILASM.GenericArguments
5 // Ankit Jain <jankit@novell.com>
7 // Copyright 2005 Novell, Inc (http://www.novell.com)
10 //Note: This is shared by modified types of the same generic instance
11 // Eg. foo`1<int32> and foo`1<int32> [] would share their GenericArguments
14 using System.Collections;
17 namespace Mono.ILASM {
19 public class GenericArguments {
24 public GenericArguments ()
32 get { return type_list.Count; }
35 public void Add (ITypeRef type)
38 throw new ArgumentException ("type");
40 if (type_list == null)
41 type_list = new ArrayList ();
47 public ITypeRef [] ToArray ()
49 if (type_list == null)
52 type_arr = (ITypeRef []) type_list.ToArray (typeof (ITypeRef));
57 public PEAPI.Type [] Resolve (CodeGen code_gen)
60 PEAPI.Type [] p_type_list = new PEAPI.Type [type_list.Count];
61 foreach (ITypeRef type in type_list) {
62 type.Resolve (code_gen);
63 p_type_list [i ++] = type.PeapiType;
69 private void MakeString ()
71 //Build full_name (foo < , >)
72 StringBuilder sb = new StringBuilder ();
74 foreach (ITypeRef tr in type_list)
75 sb.AppendFormat ("{0}, ", tr.FullName);
76 //Remove the extra ', ' at the end
79 type_str = sb.ToString ();
82 public override string ToString ()