MoveFile() public method

public MoveFile ( FilePath localSrcPath, FilePath localDestPath, bool force, MonoDevelop.Core.ProgressMonitor monitor ) : void
localSrcPath FilePath
localDestPath FilePath
force bool
monitor MonoDevelop.Core.ProgressMonitor
return void
コード例 #1
0
        public override void MoveFile(FilePath source, FilePath dest)
        {
            ProgressMonitor monitor = new ProgressMonitor();

            Repository srcRepo = GetRepository(source);
            Repository dstRepo = GetRepository(dest);

            if (dstRepo != null && dstRepo.CanMoveFilesFrom(srcRepo, source, dest))
            {
                srcRepo.MoveFile(source, dest, true, monitor);
            }
            else
            {
                CopyFile(source, dest, true);
                srcRepo.DeleteFile(source, true, monitor, false);
            }
        }
コード例 #2
0
        public override void MoveFile(string source, string dest)
        {
            IProgressMonitor monitor = new NullProgressMonitor();

            Repository srcRepo = GetRepository(source);
            Repository dstRepo = GetRepository(dest);

            if (dstRepo.CanMoveFilesFrom(srcRepo, source, dest))
            {
                srcRepo.MoveFile(source, dest, true, monitor);
            }
            else
            {
                CopyFile(source, dest, true);
                srcRepo.DeleteFile(source, true, monitor);
            }
        }