2 // delegate.cs: Delegate Handler
\r
4 // Author: Ravi Pratap (ravi@ximian.com)
\r
6 // Licensed under the terms of the GNU GPL
\r
8 // (C) 2001 Ximian, Inc (http://www.ximian.com)
\r
13 using System.Collections;
\r
14 using System.Reflection;
\r
15 using System.Reflection.Emit;
\r
19 public class Delegate {
\r
23 public int mod_flags;
\r
24 public Parameters Parameters;
\r
25 public Attributes OptAttributes;
\r
26 public TypeBuilder DelegateBuilder;
\r
30 const int AllowedModifiers =
\r
33 Modifiers.PROTECTED |
\r
34 Modifiers.INTERNAL |
\r
37 public Delegate (string type, int mod_flags, string name, Parameters param_list,
\r
38 Attributes attrs, Location loc)
\r
42 this.mod_flags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC);
\r
43 Parameters = param_list;
\r
44 OptAttributes = attrs;
\r
48 public void Define (TypeContainer parent)
\r
50 TypeAttributes attr;
\r
52 if (parent.IsTopLevel)
\r
53 attr = TypeAttributes.NestedPublic | TypeAttributes.Class;
\r
55 attr = TypeAttributes.Public | TypeAttributes.Class;
\r
57 Type t = parent.LookupType (type, false);
\r
58 Type [] param_types = Parameters.GetParameterInfo (parent);
\r
59 Type base_type = System.Type.GetType ("System.MulticastDelegate");
\r
61 DelegateBuilder = parent.TypeBuilder.DefineNestedType (Name, attr, base_type);
\r
63 //DelegateBuilder.CreateType ();
\r
68 public string Type {
\r
74 public int ModFlags {
\r