[threadpool] Added dynamic concurrent queue implementation
[mono.git] / mcs / class / IKVM.Reflection / EventInfo.cs
1 /*
2   Copyright (C) 2009 Jeroen Frijters
3
4   This software is provided 'as-is', without any express or implied
5   warranty.  In no event will the authors be held liable for any damages
6   arising from the use of this software.
7
8   Permission is granted to anyone to use this software for any purpose,
9   including commercial applications, and to alter it and redistribute it
10   freely, subject to the following restrictions:
11
12   1. The origin of this software must not be misrepresented; you must not
13      claim that you wrote the original software. If you use this software
14      in a product, an acknowledgment in the product documentation would be
15      appreciated but is not required.
16   2. Altered source versions must be plainly marked as such, and must not be
17      misrepresented as being the original software.
18   3. This notice may not be removed or altered from any source distribution.
19
20   Jeroen Frijters
21   jeroen@frijters.net
22   
23 */
24
25 namespace IKVM.Reflection
26 {
27         public abstract class EventInfo : MemberInfo
28         {
29                 // prevent external subclasses
30                 internal EventInfo()
31                 {
32                 }
33
34                 public sealed override MemberTypes MemberType
35                 {
36                         get { return MemberTypes.Event; }
37                 }
38
39                 public abstract EventAttributes Attributes { get; }
40                 public abstract MethodInfo GetAddMethod(bool nonPublic);
41                 public abstract MethodInfo GetRaiseMethod(bool nonPublic);
42                 public abstract MethodInfo GetRemoveMethod(bool nonPublic);
43                 public abstract MethodInfo[] GetOtherMethods(bool nonPublic);
44                 public abstract Type EventHandlerType { get; }
45                 internal abstract bool IsPublic { get; }
46                 internal abstract bool IsStatic { get; }
47
48                 public bool IsSpecialName
49                 {
50                         get { return (Attributes & EventAttributes.SpecialName) != 0; }
51                 }
52
53                 public MethodInfo GetAddMethod()
54                 {
55                         return GetAddMethod(false);
56                 }
57
58                 public MethodInfo GetRaiseMethod()
59                 {
60                         return GetRaiseMethod(false);
61                 }
62
63                 public MethodInfo GetRemoveMethod()
64                 {
65                         return GetRemoveMethod(false);
66                 }
67
68                 public MethodInfo[] GetOtherMethods()
69                 {
70                         return GetOtherMethods(false);
71                 }
72
73                 internal virtual EventInfo BindTypeParameters(Type type)
74                 {
75                         return new GenericEventInfo(this.DeclaringType.BindTypeParameters(type), this);
76                 }
77         }
78 }