示例#1
0
 static void OverrideLocalFileSetAttributes(GLib.GType gtype, LocalFileSetAttributesNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("local_file_set_attributes"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
示例#2
0
        private bool InternalLocalFileSetAttributes(string filename, GLib.FileInfo info, GLib.FileQueryInfoFlags flags, GLib.Cancellable cancellable)
        {
            LocalFileSetAttributesNativeDelegate unmanaged = class_abi.BaseOverride <LocalFileSetAttributesNativeDelegate>(this.LookupGType(), "local_file_set_attributes");

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

            IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup(filename);
            IntPtr error           = IntPtr.Zero;
            bool   __result        = unmanaged(this.Handle, native_filename, info == null ? IntPtr.Zero : info.Handle, (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            GLib.Marshaller.Free(native_filename);
            return(__result);
        }
示例#3
0
        private bool InternalLocalFileSetAttributes(string filename, GLib.FileInfo info, GLib.FileQueryInfoFlags flags, GLib.Cancellable cancellable)
        {
            LocalFileSetAttributesNativeDelegate unmanaged = null;

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

            IntPtr native_filename = GLib.Marshaller.StringToPtrGStrdup(filename);
            IntPtr error           = IntPtr.Zero;
            bool   __result        = unmanaged(this.Handle, native_filename, info == null ? IntPtr.Zero : info.Handle, (int)flags, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);

            GLib.Marshaller.Free(native_filename);
            return(__result);
        }
示例#4
0
文件: Vfs.cs 项目: akrisiun/gtk-sharp
		static void OverrideLocalFileSetAttributes (GLib.GType gtype, LocalFileSetAttributesNativeDelegate callback)
		{
			GVfsClass class_iface = GetClassStruct (gtype, false);
			class_iface.LocalFileSetAttributes = callback;
			OverrideClassStruct (gtype, class_iface);
		}