Example #1
0
        public void CopyFileToDirectory(string filenameString, string workingDirectory, bool replace)
        {
            var filePath      = XIO.AbsoluteFilePath(filenameString);
            var directoryPath = XIO.DirectoryPath(workingDirectory);



            var destinationFilePath = Combine(directoryPath, XIO.RelativeFilePath(filePath.Filename.Value));

            System.IO.File.Copy(filePath.Value, destinationFilePath.Value, replace);
        }
Example #2
0
        public AbsoluteFilePath[] GetFiles(DirectoryPath directory)
        {
            System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(directory.Value);

            var fileInfos = directoryInfo.GetFiles();

            AbsoluteFilePath[] files = new AbsoluteFilePath[fileInfos.Length];

            for (int i = 0; i < fileInfos.Length; i++)
            {
                files[i] = XIO.AbsoluteFilePath(fileInfos[i]);
            }

            return(files);
        }