svn path=/branches/mono-1-1-9/mcs/; revision=51206
[mono.git] / mcs / ilasm / codegen / GenericMethodRef.cs
1 //
2 // Mono.ILASM.GenericMethodRef
3 //
4 // Author(s):
5 //  Jackson Harper (jackson@ximian.com)
6 //
7 // (C) 2003 Ximian, Inc (http://www.ximian.com)
8 //
9
10
11 using System;
12
13 namespace Mono.ILASM {
14
15         public class GenericMethodRef : IMethodRef {
16
17                 private IMethodRef meth;
18                 private GenericMethodSig sig;
19                 private bool is_resolved;
20
21                 public GenericMethodRef (IMethodRef meth, GenericMethodSig sig)
22                 {
23                         this.meth = meth;
24                         this.sig = sig;
25                         is_resolved = false;
26                 }
27
28                 public PEAPI.Method PeapiMethod {
29                         get { return meth.PeapiMethod; }
30                 }
31
32                 public PEAPI.CallConv CallConv {
33                         get { return meth.CallConv; }
34                         set { meth.CallConv = value; }
35                 }
36
37                 public ITypeRef Owner {
38                         get { return null; }
39                 }
40
41                 public void Resolve (CodeGen code_gen)
42                 {
43                         if (is_resolved)
44                                 return;
45
46                         meth.Resolve (code_gen);
47                         code_gen.PEFile.AddMethodSpec (meth.PeapiMethod, sig.Resolve (code_gen));
48
49                         is_resolved = true;
50                 }
51         }
52
53 }
54