summaryrefslogtreecommitdiff
path: root/src/msil/ch/epfl/lamp/compiler/msil/EventInfo.java
blob: 3ccba7900b3322258b978162e0a7b1259614678b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * System.Reflection-like API for access to .NET assemblies (DLL & EXE)
 */


package ch.epfl.lamp.compiler.msil;


/**
 * Discovers the attributes of an event
 * and provides access to event metadata.
 *
 * @author Nikolay Mihaylov
 * @version 1.0
 */
public class EventInfo extends MemberInfo {

    //##########################################################################

    public final int MemberType() { return MemberTypes.Event; }

    /** Attributes associated with the event. */
    public final short Attributes;

    /** The Type object for the underlying event-handler delegate
     *  associated with this event.
     */
    public final Type EventHandlerType;

    public MethodInfo GetAddMethod() { return addMethod; }

    public MethodInfo GetRemoveMethod() { return removeMethod; }

    public String toString() {
        return "" + EventHandlerType + " " + Name;
    }

    //##########################################################################

    protected static final EventInfo[] EMPTY_ARRAY = new EventInfo[0];

    protected MethodInfo addMethod;

    protected MethodInfo removeMethod;

    protected EventInfo(String name, Type declType, short attr,
                        Type handlerType, MethodInfo add, MethodInfo remove)
    {
        super(name, declType);
        Attributes = attr;
        EventHandlerType = handlerType;
        this.addMethod = add;
        this.removeMethod = remove;
    }

    //##########################################################################

} // class EventInfo