Пример #1
0
        private bool RenameFile(string pathFrom, string pathTo)
        {
            string message = string.Empty;

            return(TransactionFile.MoveFile(
                       pathFrom, pathTo,
                       ref message));
        }
Пример #2
0
        public static bool RenameFile(FileArgs args, IBasicPanel <Project> control, ref string message)
        {
            string path = Path.Combine(control.FSWorker.WorkDirectory, args.Project, BrowseSystem.SubFolder);

            TransactionFile.MoveFile(Path.Combine(path, args.RenamedArgs.From),
                                     Path.Combine(path, args.RenamedArgs.To), ref message);
            return(Save(control.Save(args.Project, control.SaveItemManager.DoSave(args)),
                        Path.Combine(control.FSWorker.WorkDirectory, args.Project, args.Project + ProjectExtension), ref message));
        }
Пример #3
0
 private static void CopyDirectories(string path, string pathTo, ref string message)
 {
     //pathTo = Path.Combine(pathTo, Path.GetDirectoryName(path));
     if (!CreateDirectory(pathTo, ref message))
     {
         return;
     }
     foreach (var file in Directory.GetFiles(path))
     {
         if (!TransactionFile.MoveFile(Path.Combine(path, file), Path.Combine(pathTo, Path.GetFileName(file)), ref message))
         {
             return;
         }
     }
     foreach (var directory in Directory.GetDirectories(path))
     {
         string name = new DirectoryInfo(directory).Name;
         CopyDirectories(Path.Combine(path, name), Path.Combine(pathTo, name), ref message);
     }
 }