示例#1
0
        ///<summary>
        /// Copies the fileset to the destination
        ///</summary>
        ///<param name="destination">Path to a folder that will recieve the files</param>
        ///<returns></returns>
        public Core.FileSet To(string destination)
        {
//            Logger.Write("copy", String.Format("Copying {0} files to '{1}'", _fileSet.Files.Count, destination));
            foreach (string file in _fileSet.Files)
            {
                //              Logger.WriteDebugMessage(String.Format("Path: {0}\\{1}", destination, Path.GetFileName(file)));
                string destinationPath = Path.Combine(destination.ToString(), Path.GetFileName(file));
                FailableActionExecutor.DoAction <string, string>(this.OnError, _fileSystemWrapper.Copy, file, destinationPath);
            }
            return(_fileSet);
        }
示例#2
0
 ///<summary>
 /// Creates the folder
 ///</summary>
 ///<param name="onError">Allows you to set the error behavior</param>
 ///<returns></returns>
 public Directory Create(OnError onError)
 {
     FailableActionExecutor.DoAction(onError, _fileSystemWrapper.CreateDirectory, _path);
     return(this);
 }
示例#3
0
 ///<summary>
 /// Deletes the file
 ///<remarks>If the file does not exist no error will be thrown (even if OnError is set to fail)</remarks>
 /// <param name="onError">Sets wether to fail or continue if an error occurs</param>
 ///</summary>
 public void Delete(OnError onError)
 {
     FailableActionExecutor.DoAction(onError, _fileSystemWrapper.DeleteFile, Path);
 }