Пример #1
0
 static void OverrideHandleEvent(GLib.GType gtype, HandleEventNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("handle_event"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Пример #2
0
        private bool InternalHandleEvent(Gst.Event evnt)
        {
            HandleEventNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("handle_event"));
                unmanaged = (HandleEventNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(HandleEventNativeDelegate));
            }
            if (unmanaged == null)
            {
                return(false);
            }

            bool __result = unmanaged(this.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);

            return(__result);
        }