IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
EventInfoWithReflectedType.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009-2012 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*/
24using System.Diagnostics;
25
26namespace IKVM.Reflection
27{
28
29 sealed class EventInfoWithReflectedType : EventInfo
30 {
31
32 readonly Type reflectedType;
33 readonly EventInfo eventInfo;
34
40 internal EventInfoWithReflectedType(Type reflectedType, EventInfo eventInfo)
41 {
42 Debug.Assert(reflectedType != eventInfo.DeclaringType);
43 this.reflectedType = reflectedType;
44 this.eventInfo = eventInfo;
45 }
46
47 public override EventAttributes Attributes
48 {
49 get { return eventInfo.Attributes; }
50 }
51
52 public override MethodInfo GetAddMethod(bool nonPublic)
53 {
54 return SetReflectedType(eventInfo.GetAddMethod(nonPublic), reflectedType);
55 }
56
57 public override MethodInfo GetRaiseMethod(bool nonPublic)
58 {
59 return SetReflectedType(eventInfo.GetRaiseMethod(nonPublic), reflectedType);
60 }
61
62 public override MethodInfo GetRemoveMethod(bool nonPublic)
63 {
64 return SetReflectedType(eventInfo.GetRemoveMethod(nonPublic), reflectedType);
65 }
66
67 public override MethodInfo[] GetOtherMethods(bool nonPublic)
68 {
69 return SetReflectedType(eventInfo.GetOtherMethods(nonPublic), reflectedType);
70 }
71
72 public override MethodInfo[] __GetMethods()
73 {
74 return SetReflectedType(eventInfo.__GetMethods(), reflectedType);
75 }
76
77 public override Type EventHandlerType
78 {
79 get { return eventInfo.EventHandlerType; }
80 }
81
82 internal override bool IsPublic
83 {
84 get { return eventInfo.IsPublic; }
85 }
86
87 internal override bool IsNonPrivate
88 {
89 get { return eventInfo.IsNonPrivate; }
90 }
91
92 internal override bool IsStatic
93 {
94 get { return eventInfo.IsStatic; }
95 }
96
97 internal override EventInfo BindTypeParameters(Type type)
98 {
99 return eventInfo.BindTypeParameters(type);
100 }
101
102 public override string ToString()
103 {
104 return eventInfo.ToString();
105 }
106
107 public override bool __IsMissing
108 {
109 get { return eventInfo.__IsMissing; }
110 }
111
112 public override Type DeclaringType
113 {
114 get { return eventInfo.DeclaringType; }
115 }
116
117 public override Type ReflectedType
118 {
119 get { return reflectedType; }
120 }
121
122 public override bool Equals(object obj)
123 {
124 var other = obj as EventInfoWithReflectedType;
125 return other != null
126 && other.reflectedType == reflectedType
127 && other.eventInfo == eventInfo;
128 }
129
130 public override int GetHashCode()
131 {
132 return reflectedType.GetHashCode() ^ eventInfo.GetHashCode();
133 }
134
135 public override int MetadataToken
136 {
137 get { return eventInfo.MetadataToken; }
138 }
139
140 public override Module Module
141 {
142 get { return eventInfo.Module; }
143 }
144
145 public override string Name
146 {
147 get { return eventInfo.Name; }
148 }
149
150 internal override bool IsBaked
151 {
152 get { return eventInfo.IsBaked; }
153 }
154
155 internal override int GetCurrentToken()
156 {
157 return eventInfo.GetCurrentToken();
158 }
159
160 }
161
162}
IKVM.Reflection.Type Type
IKVM.Reflection.EventInfo EventInfo
global::java.lang.invoke.LambdaForm.Name Name
override MethodInfo GetRemoveMethod(bool nonPublic)
override MethodInfo[] GetOtherMethods(bool nonPublic)
override MethodInfo GetRaiseMethod(bool nonPublic)
override MethodInfo GetAddMethod(bool nonPublic)