2001-09-06 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / mcs / delegate.cs
1 //\r
2 // delegate.cs: Delegate Handler\r
3 //\r
4 // Author: Ravi Pratap (ravi@ximian.com)\r
5 //\r
6 // Licensed under the terms of the GNU GPL\r
7 //\r
8 // (C) 2001 Ximian, Inc (http://www.ximian.com)\r
9 //\r
10 //\r
11 \r
12 using System;\r
13 using System.Collections;\r
14 using System.Reflection;\r
15 using System.Reflection.Emit;\r
16 \r
17 namespace CIR {\r
18         \r
19         public class Delegate : DeclSpace {\r
20 \r
21                 public string name;\r
22                 public string type;\r
23                 public int    mod_flags;\r
24                 public Parameters parameters;\r
25                 public Attributes OptAttributes;\r
26 \r
27                 const int AllowedModifiers =\r
28                         Modifiers.NEW |\r
29                         Modifiers.PUBLIC |\r
30                         Modifiers.PROTECTED |\r
31                         Modifiers.INTERNAL |\r
32                         Modifiers.PRIVATE;\r
33 \r
34                 public Delegate (string type, int mod_flags, string name, Parameters param_list,\r
35                                  Attributes attrs) : base (name)\r
36                 {\r
37                         this.name       = name;\r
38                         this.type       = type;\r
39                         this.mod_flags  = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC);\r
40                         parameters      = param_list;\r
41                         OptAttributes   = attrs;\r
42                 }\r
43                     \r
44                 \r
45                 public string Type {\r
46                         get {\r
47                                 return type;\r
48                         }\r
49                 }\r
50 \r
51                 public int ModFlags {\r
52                         get {\r
53                                 return mod_flags;\r
54                         }\r
55                 }\r
56                 \r
57 \r
58         }\r
59         \r
60 }\r