copying the latest Sys.Web.Services from trunk.
[mono.git] / mcs / ilasm / codegen / CustomAttr.cs
1 //
2 // Mono.ILASM.CustomAttr
3 //
4 // Author(s):
5 //  Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
9
10
11 using System;
12 using System.Collections;
13
14 namespace Mono.ILASM {
15
16         public interface ICustomAttrTarget {
17                 void AddCustomAttribute (CustomAttr customattr);
18         }
19
20         public class CustomAttr {
21
22                 private IMethodRef method_ref;
23                 private byte[] data;
24
25                 public CustomAttr (IMethodRef method_ref, byte[] data)
26                 {
27                         this.method_ref = method_ref;
28                         this.data = data;
29                 }
30
31                 public void AddTo (CodeGen code_gen, PEAPI.MetaDataElement elem)
32                 {
33                         method_ref.Resolve (code_gen);
34                         code_gen.PEFile.AddCustomAttribute (method_ref.PeapiMethod, data, elem);
35                 }
36
37         }
38
39 }
40