Пример #1
0
 static void OverrideCloseFn(GLib.GType gtype, CloseFnNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("close_fn"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Пример #2
0
        private bool InternalCloseFn(GLib.Cancellable cancellable)
        {
            CloseFnNativeDelegate unmanaged = class_abi.BaseOverride <CloseFnNativeDelegate>(this.LookupGType(), "close_fn");

            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            return(__result);
        }
Пример #3
0
        private bool InternalCloseFn(GLib.Cancellable cancellable)
        {
            CloseFnNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("close_fn"));
                unmanaged = (CloseFnNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseFnNativeDelegate));
            }
            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr error    = IntPtr.Zero;
            bool   __result = unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            return(__result);
        }
Пример #4
0
		static void OverrideCloseFn (GLib.GType gtype, CloseFnNativeDelegate callback)
		{
			GIOStreamClass class_iface = GetClassStruct (gtype, false);
			class_iface.CloseFn = callback;
			OverrideClassStruct (gtype, class_iface);
		}