In ilasm/codegen:
[mono.git] / mcs / ilasm / codegen / Module.cs
1 //
2 // Mono.ILASM.Module
3 //
4 // Author(s):
5 //  Ankit Jain  <jankit@novell.com>
6 //
7 // Copyright 2006 Novell, Inc (http://www.novell.com)
8 //
9
10 using System;
11 using System.Collections;
12
13 namespace Mono.ILASM {
14
15         public class Module : ICustomAttrTarget {
16                 string name;
17                 ArrayList customattr_list;
18
19                 public Module (string name)
20                 {
21                         this.name = name;
22                         customattr_list = null;
23                 }
24
25                 public string Name {
26                         get { return name; }
27                 }
28
29                 public void AddCustomAttribute (CustomAttr customattr)
30                 {
31                         if (customattr_list == null)
32                                 customattr_list = new ArrayList ();
33
34                         customattr_list.Add (customattr);
35                 }
36
37                 public void Resolve (CodeGen code_gen, PEAPI.Module module)
38                 {
39                         if (customattr_list == null)
40                                 return;
41
42                         foreach (CustomAttr customattr in customattr_list)
43                                 customattr.AddTo (code_gen, module);
44                 }
45         }
46 }