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 : DeclSpace {
\r
23 public int mod_flags;
\r
24 public Parameters Parameters;
\r
25 public Attributes OptAttributes;
\r
26 public TypeBuilder DelegateBuilder;
\r
28 const int AllowedModifiers =
\r
31 Modifiers.PROTECTED |
\r
32 Modifiers.INTERNAL |
\r
35 public Delegate (string type, int mod_flags, string name, Parameters param_list,
\r
36 Attributes attrs) : base (name)
\r
40 this.mod_flags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC);
\r
41 Parameters = param_list;
\r
42 OptAttributes = attrs;
\r
45 public void Define (TypeContainer parent)
\r
47 TypeAttributes attr = Modifiers.TypeAttr (ModFlags, parent);
\r
49 Type t = parent.LookupType (type, false);
\r
50 Type [] param_types = Parameters.GetParameterInfo (parent);
\r
51 Type base_type = System.Type.GetType ("System.MulticastDelegate");
\r
53 DelegateBuilder = parent.TypeBuilder.DefineNestedType (name, attr, base_type);
\r
55 // FIXME : Need to figure out how to proceed from here.
\r
60 public string Type {
\r
66 public int ModFlags {
\r