* CustomAttr.cs: New file - Custom attributes
[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
13
14 namespace Mono.ILASM {
15
16         public class CustomAttr {
17
18                 private IMethodRef method_ref;
19                 private byte[] data;
20
21                 public CustomAttr (IMethodRef method_ref, byte[] data)
22                 {
23                         this.method_ref = method_ref;
24                         this.data = data;
25                 }
26
27                 public void AddTo (CodeGen code_gen, PEAPI.MetaDataElement elem)
28                 {
29                         method_ref.Resolve (code_gen);
30
31                         elem.AddCustomAttribute (method_ref.PeapiMethod, data);
32                 }
33
34         }
35
36 }
37