示例#1
0
        public async Task DoAFileMove()
        {
            CreateTestFile();
            var result = await FileWithProgress.MoveAsync(TestFilePath, TestDestinationPath, ProgressUpdater);

            Assert.IsTrue(result);

            Assert.IsTrue(File.Exists(TestDestinationPath));

            Assert.IsFalse(File.Exists(TestFilePath));
        }
示例#2
0
 public async Task <bool> MoveAsync(string sourcePath, string destinationPath, Action <decimal> updateProgressAsPct)
 {
     this.IsCancelled         = false;
     this.UpdateProgressAsPct = updateProgressAsPct;
     try
     {
         _isMoving = true;
         return(await FileWithProgress.MoveAsync(sourcePath, destinationPath, ProgressCallback, this));
     }
     finally
     {
         _isMoving = false;
     }
 }