Пример #1
0
        public FileInformation GenerateFullyQualifiedName(FileInformation fileInformation, string destinationDirectory)
        {
            FileInformation resultingFileInformation = fileInformation;

            resultingFileInformation.Album           = AlbumNameGenerator.GenerateAlbumName(fileInformation.FileName);
            resultingFileInformation.DestinationPath = destinationDirectory + fileInformation.Album + @"\";
            bool isUnique = false;
            int  counter  = 0;

            while (!isUnique)
            {
                string uniqueFileName = resultingFileInformation.DestinationPath + GenerateFileNameSequence(fileInformation, counter);

                if (_fileOperations.DoesFileExist(uniqueFileName) == false)
                {
                    resultingFileInformation.FullyQualifiedDestinationName = uniqueFileName;
                    isUnique = true;
                }

                counter++;
            }
            return(resultingFileInformation);
        }