static void OverrideToNative(GLib.GType gtype, ToNativeNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("to_native")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private bool InternalToNative(IntPtr dest, ulong destlen) { ToNativeNativeDelegate unmanaged = class_abi.BaseOverride <ToNativeNativeDelegate>(this.LookupGType(), "to_native"); if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } IntPtr error = IntPtr.Zero; bool __result = unmanaged(this.Handle, dest, new UIntPtr(destlen), out error); return(__result); }
private bool InternalToNative(IntPtr dest, ulong destlen) { ToNativeNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("to_native")); unmanaged = (ToNativeNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ToNativeNativeDelegate)); } if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } IntPtr error = IntPtr.Zero; bool __result = unmanaged(this.Handle, dest, new UIntPtr(destlen), out error); return(__result); }
static void OverrideToNative (GLib.GType gtype, ToNativeNativeDelegate callback) { GSocketAddressClass class_iface = GetClassStruct (gtype, false); class_iface.ToNative = callback; OverrideClassStruct (gtype, class_iface); }