Exemplo n.º 1
0
 internal static EventInfo GetEventFromHandle(Mono.RuntimeEventHandle handle)
 {
     if (handle.Value == IntPtr.Zero)
     {
         throw new ArgumentException("The handle is invalid.");
     }
     return(internal_from_handle_type(handle.Value, IntPtr.Zero));
 }
Exemplo n.º 2
0
        internal static EventInfo GetEventFromHandle(Mono.RuntimeEventHandle handle, RuntimeTypeHandle reflectedType)
        {
            if (handle.Value == IntPtr.Zero)
            {
                throw new ArgumentException("The handle is invalid.");
            }
            EventInfo ei = internal_from_handle_type(handle.Value, reflectedType.Value);

            if (ei == null)
            {
                throw new ArgumentException("The event handle and the type handle are incompatible.");
            }
            return(ei);
        }
Exemplo n.º 3
0
        RuntimeEventInfo[] GetEvents_internal(string name, BindingFlags bindingAttr, MemberListType listType, RuntimeType reflectedType)
        {
            var refh = new RuntimeTypeHandle(reflectedType);

            using (var namePtr = new Mono.SafeStringMarshal(name))
                using (var h = new Mono.SafeGPtrArrayHandle(GetEvents_native(namePtr.Value, listType))) {
                    int n = h.Length;
                    var a = new RuntimeEventInfo[n];
                    for (int i = 0; i < n; i++)
                    {
                        var eh = new Mono.RuntimeEventHandle(h[i]);
                        a[i] = (RuntimeEventInfo)EventInfo.GetEventFromHandle(eh, refh);
                    }
                    return(a);
                }
        }
Exemplo n.º 4
0
		RuntimeEventInfo[] GetEvents_internal (string name, BindingFlags bindingAttr, RuntimeType reflectedType)
		{
			var refh = new RuntimeTypeHandle (reflectedType);
			using (var h = new Mono.SafeGPtrArrayHandle (GetEvents_native (name, bindingAttr))) {
				int n = h.Length;
				var a = new RuntimeEventInfo[n];
				for (int i = 0; i < n; i++) {
					var eh = new Mono.RuntimeEventHandle (h[i]);
					a[i] = (RuntimeEventInfo) EventInfo.GetEventFromHandle (eh, refh);
				}
				return a;
			}
		}