static void OverrideCancelled(GLib.GType gtype, CancelledNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("cancelled")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalCancelled() { CancelledNativeDelegate unmanaged = class_abi.BaseOverride <CancelledNativeDelegate>(this.LookupGType(), "cancelled"); if (unmanaged == null) { return; } unmanaged(this.Handle); }
private void InternalCancelled() { CancelledNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("cancelled")); unmanaged = (CancelledNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CancelledNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle); }
static void OverrideCancelled (GLib.GType gtype, CancelledNativeDelegate callback) { GCancellableClass class_iface = GetClassStruct (gtype, false); class_iface.Cancelled = callback; OverrideClassStruct (gtype, class_iface); }