예제 #1
0
        public bool open(ch.cyberduck.core.Local local, Application application, ApplicationQuitCallback callback)
        {
            Process process = new Process();

            if (null == application)
            {
                process.StartInfo.FileName = "\"" + local.getAbsolute() + "\"";
            }
            else
            {
                process.StartInfo.FileName  = GetExecutableCommand(application.getIdentifier());
                process.StartInfo.Arguments = "\"" + local.getAbsolute() + "\"";
            }
            return(Utils.StartProcess(process));
        }
예제 #2
0
        public bool open(ch.cyberduck.core.Local local)
        {
            Process process = new Process();

            process.StartInfo.FileName = "\"" + local.getAbsolute() + "\"";
            return(Utils.StartProcess(process));
        }
 public void trash(ch.cyberduck.core.Local file)
 {
     if (file.exists())
     {
         try {
             if (file.isFile())
             {
                 FileSystem.DeleteFile(file.getAbsolute(), UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
             }
             else if (file.isDirectory())
             {
                 FileSystem.DeleteDirectory(file.getAbsolute(), UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
             }
         }
         catch (System.Exception e) {
             throw new LocalAccessDeniedException(e.Message);
         }
     }
 }
        public bool reveal(ch.cyberduck.core.Local l)
        {
            IntPtr nativeFolder = IntPtr.Zero;

            try
            {
                uint psfgaoOut;
                NativeMethods.SHParseDisplayName(l.getParent().getAbsolute(), IntPtr.Zero, out nativeFolder, 0, out psfgaoOut);

                if (nativeFolder == IntPtr.Zero)
                {
                    return(false);
                }

                IntPtr nativeFile = IntPtr.Zero;
                try
                {
                    NativeMethods.SHParseDisplayName(l.getAbsolute(), IntPtr.Zero, out nativeFile, 0, out psfgaoOut);

                    IntPtr[] fileArray;
                    if (nativeFile != IntPtr.Zero)
                    {
                        fileArray = new IntPtr[] { nativeFile };
                    }
                    else
                    {
                        fileArray = new IntPtr[] { };
                    }

                    NativeMethods.SHOpenFolderAndSelectItems(nativeFolder, (uint)fileArray.Length, fileArray, 0);
                }
                finally
                {
                    if (nativeFile != IntPtr.Zero)
                    {
                        Marshal.FreeCoTaskMem(nativeFile);
                    }
                }
            }
            finally
            {
                if (nativeFolder != IntPtr.Zero)
                {
                    Marshal.FreeCoTaskMem(nativeFolder);
                }
            }
            return(true);
        }
 public bool reveal(ch.cyberduck.core.Local l)
 {
     if (l.exists())
     {
         string        path      = l.getAbsolute();
         DirectoryInfo d         = new DirectoryInfo(path);
         string        parameter = "";
         if (d.Parent != null)
         {
             parameter = "/select,";
         }
         return(ApplicationLauncherFactory.get()
                .open(new Application("explorer.exe", null), parameter + path));
     }
     return(false);
 }