static void OverrideCustomItemActivated(GLib.GType gtype, CustomItemActivatedNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("custom_item_activated")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalCustomItemActivated(string item_name) { CustomItemActivatedNativeDelegate unmanaged = class_abi.BaseOverride <CustomItemActivatedNativeDelegate>(this.LookupGType(), "custom_item_activated"); if (unmanaged == null) { return; } IntPtr native_item_name = GLib.Marshaller.StringToPtrGStrdup(item_name); unmanaged(this.Handle, native_item_name); GLib.Marshaller.Free(native_item_name); }
private void InternalCustomItemActivated(string item_name) { CustomItemActivatedNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("custom_item_activated")); unmanaged = (CustomItemActivatedNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CustomItemActivatedNativeDelegate)); } if (unmanaged == null) { return; } IntPtr native_item_name = GLib.Marshaller.StringToPtrGStrdup(item_name); unmanaged(this.Handle, native_item_name); GLib.Marshaller.Free(native_item_name); }
static void OverrideCustomItemActivated (GLib.GType gtype, CustomItemActivatedNativeDelegate callback) { GtkAppChooserButtonClass class_iface = GetClassStruct (gtype, false); class_iface.CustomItemActivated = callback; OverrideClassStruct (gtype, class_iface); }