| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // System.Reflection/MonoEvent.cs
- //
- // Author:
- // Paolo Molaro ([email protected])
- //
- // (C) 2001 Ximian, Inc. http://www.ximian.com
- //
- using System;
- using System.Reflection;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- namespace System.Reflection {
- internal struct MonoEventInfo {
- public Type parent;
- public String name;
- public MethodInfo add_method;
- public MethodInfo remove_method;
- public MethodInfo raise_method;
- public EventAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_event_info (MonoEvent ev, out MonoEventInfo info);
- }
- internal sealed class MonoEvent: EventInfo {
- IntPtr klass;
- IntPtr handle;
- public override EventAttributes Attributes {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.attrs;
- }
- }
- public override MethodInfo GetAddMethod(bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.add_method;
- }
- public override MethodInfo GetRaiseMethod( bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.raise_method;
- }
- public override MethodInfo GetRemoveMethod( bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.remove_method;
- }
- public override Type DeclaringType {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.parent;
- }
- }
- public override Type ReflectedType {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.name;
- }
- }
- }
- }
|