static void OverrideQueryInfoAsync(GLib.GType gtype, QueryInfoAsyncNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("query_info_async")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalQueryInfoAsync(string attributes, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { QueryInfoAsyncNativeDelegate unmanaged = class_abi.BaseOverride <QueryInfoAsyncNativeDelegate>(this.LookupGType(), "query_info_async"); if (unmanaged == null) { return; } IntPtr native_attributes = GLib.Marshaller.StringToPtrGStrdup(attributes); GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb); cb_wrapper.PersistUntilCalled(); unmanaged(this.Handle, native_attributes, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero); GLib.Marshaller.Free(native_attributes); }
private void InternalQueryInfoAsync(string attributes, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { QueryInfoAsyncNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("query_info_async")); unmanaged = (QueryInfoAsyncNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(QueryInfoAsyncNativeDelegate)); } if (unmanaged == null) { return; } IntPtr native_attributes = GLib.Marshaller.StringToPtrGStrdup(attributes); GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb); cb_wrapper.PersistUntilCalled(); unmanaged(this.Handle, native_attributes, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero); GLib.Marshaller.Free(native_attributes); }
static void OverrideQueryInfoAsync (GLib.GType gtype, QueryInfoAsyncNativeDelegate callback) { GFileIOStreamClass class_iface = GetClassStruct (gtype, false); class_iface.QueryInfoAsync = callback; OverrideClassStruct (gtype, class_iface); }