static void OverrideToBytes(GLib.GType gtype, ToBytesNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("to_bytes")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private byte InternalToBytes() { ToBytesNativeDelegate unmanaged = class_abi.BaseOverride <ToBytesNativeDelegate>(this.LookupGType(), "to_bytes"); if (unmanaged == null) { return(0); } byte __result = unmanaged(this.Handle); return(__result); }
private byte InternalToBytes() { ToBytesNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("to_bytes")); unmanaged = (ToBytesNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ToBytesNativeDelegate)); } if (unmanaged == null) { return(0); } byte __result = unmanaged(this.Handle); return(__result); }
static void OverrideToBytes (GLib.GType gtype, ToBytesNativeDelegate callback) { GInetAddressClass class_iface = GetClassStruct (gtype, false); class_iface.ToBytes = callback; OverrideClassStruct (gtype, class_iface); }