static void OverrideSeek(GLib.GType gtype, SeekNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("seek")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private bool InternalSeek(long offset, GLib.SeekType type, GLib.Cancellable cancellable) { SeekNativeDelegate unmanaged = class_abi.BaseOverride <SeekNativeDelegate>(this.LookupGType(), "seek"); if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } IntPtr error = IntPtr.Zero; bool __result = unmanaged(this.Handle, offset, (int)type, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error); return(__result); }
private bool InternalSeek(long offset, GLib.SeekType type, GLib.Cancellable cancellable) { SeekNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("seek")); unmanaged = (SeekNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SeekNativeDelegate)); } if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } IntPtr error = IntPtr.Zero; bool __result = unmanaged(this.Handle, offset, (int)type, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error); return(__result); }
static void OverrideSeek (GLib.GType gtype, SeekNativeDelegate callback) { GFileIOStreamClass class_iface = GetClassStruct (gtype, false); class_iface.Seek = callback; OverrideClassStruct (gtype, class_iface); }