Пример #1
0
 static void OverrideActiveChanged(GLib.GType gtype, ActiveChangedNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("active_changed"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Пример #2
0
        private void InternalActiveChanged(bool active)
        {
            ActiveChangedNativeDelegate unmanaged = null;

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

            unmanaged(this.Handle, active);
        }