In ilasm/codegen:
[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                 private PEAPI.Method ms;
21
22                 public GenericMethodRef (IMethodRef meth, GenericMethodSig sig)
23                 {
24                         this.meth = meth;
25                         this.sig = sig;
26                         ms = null;
27                         is_resolved = false;
28                 }
29
30                 public PEAPI.Method PeapiMethod {
31                         get { return ms; }
32                 }
33
34                 public PEAPI.CallConv CallConv {
35                         get { return meth.CallConv; }
36                         set { meth.CallConv = value; }
37                 }
38
39                 public ITypeRef Owner {
40                         get { return null; }
41                 }
42
43                 public void Resolve (CodeGen code_gen)
44                 {
45                         if (is_resolved)
46                                 return;
47
48                         meth.Resolve (code_gen);
49                         ms = code_gen.PEFile.AddMethodSpec (meth.PeapiMethod, sig.Resolve (code_gen));
50
51                         is_resolved = true;
52                 }
53         }
54
55 }
56