Beispiel #1
0
 static void OverrideLocalFileAddInfo(GLib.GType gtype, LocalFileAddInfoNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("local_file_add_info"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Beispiel #2
0
        private void InternalLocalFileAddInfo(string filename, ulong device, GLib.FileAttributeMatcher attribute_matcher, GLib.FileInfo info, GLib.Cancellable cancellable, IntPtr extra_data, out GLib.DestroyNotify free_extra_data)
        {
            LocalFileAddInfoNativeDelegate unmanaged = class_abi.BaseOverride <LocalFileAddInfoNativeDelegate>(this.LookupGType(), "local_file_add_info");

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

            IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup(filename);

            unmanaged(this.Handle, native_filename, device, attribute_matcher == null ? IntPtr.Zero : attribute_matcher.Handle, info == null ? IntPtr.Zero : info.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, extra_data, out free_extra_data);
            GLib.Marshaller.Free(native_filename);
        }
Beispiel #3
0
        private void InternalLocalFileAddInfo(string filename, ulong device, GLib.FileAttributeMatcher attribute_matcher, GLib.FileInfo info, GLib.Cancellable cancellable, IntPtr extra_data, out GLib.DestroyNotify free_extra_data)
        {
            LocalFileAddInfoNativeDelegate unmanaged = null;

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

            IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup(filename);

            unmanaged(this.Handle, native_filename, device, attribute_matcher == null ? IntPtr.Zero : attribute_matcher.Handle, info == null ? IntPtr.Zero : info.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, extra_data, out free_extra_data);
            GLib.Marshaller.Free(native_filename);
        }
Beispiel #4
0
		static void OverrideLocalFileAddInfo (GLib.GType gtype, LocalFileAddInfoNativeDelegate callback)
		{
			GVfsClass class_iface = GetClassStruct (gtype, false);
			class_iface.LocalFileAddInfo = callback;
			OverrideClassStruct (gtype, class_iface);
		}