static void OverrideNextAsync(GLib.GType gtype, NextAsyncNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("next_async"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Example #2
0
        private void InternalNextAsync(GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
        {
            NextAsyncNativeDelegate unmanaged = class_abi.BaseOverride <NextAsyncNativeDelegate>(this.LookupGType(), "next_async");

            if (unmanaged == null)
            {
                return;
            }

            GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
            cb_wrapper.PersistUntilCalled();
            unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
        private void InternalNextAsync(GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
        {
            NextAsyncNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("next_async"));
                unmanaged = (NextAsyncNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(NextAsyncNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
            cb_wrapper.PersistUntilCalled();
            unmanaged(this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
		static void OverrideNextAsync (GLib.GType gtype, NextAsyncNativeDelegate callback)
		{
			GSocketAddressEnumeratorClass class_iface = GetClassStruct (gtype, false);
			class_iface.NextAsync = callback;
			OverrideClassStruct (gtype, class_iface);
		}