static void OverrideGetItemAttributeValue(GLib.GType gtype, GetItemAttributeValueNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("get_item_attribute_value")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private GLib.Variant InternalGetItemAttributeValue(int item_index, string attribute, GLib.VariantType expected_type) { GetItemAttributeValueNativeDelegate unmanaged = class_abi.BaseOverride <GetItemAttributeValueNativeDelegate>(this.LookupGType(), "get_item_attribute_value"); if (unmanaged == null) { return(null); } IntPtr native_attribute = GLib.Marshaller.StringToPtrGStrdup(attribute); IntPtr __result = unmanaged(this.Handle, item_index, native_attribute, expected_type == null ? IntPtr.Zero : expected_type.Handle); GLib.Marshaller.Free(native_attribute); return(new GLib.Variant(__result)); }
private GLib.Variant InternalGetItemAttributeValue(int item_index, string attribute, GLib.VariantType expected_type) { GetItemAttributeValueNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("get_item_attribute_value")); unmanaged = (GetItemAttributeValueNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetItemAttributeValueNativeDelegate)); } if (unmanaged == null) { return(null); } IntPtr native_attribute = GLib.Marshaller.StringToPtrGStrdup(attribute); IntPtr __result = unmanaged(this.Handle, item_index, native_attribute, expected_type == null ? IntPtr.Zero : expected_type.Handle); GLib.Marshaller.Free(native_attribute); return(new GLib.Variant(__result)); }