Bloom.CollectionTab.LibraryListView.GetAvailableDirectory C# (CSharp) Method

GetAvailableDirectory() private static method

Get an avaialble directory name for a new copy of a book
private static GetAvailableDirectory ( string collectionDir, string baseName, int copyNum ) : string
collectionDir string
baseName string
copyNum int
return string
        private static string GetAvailableDirectory(string collectionDir, string baseName, int copyNum)
        {
            string newName;
            if (copyNum == 1)
                newName = baseName + " - Copy";
            else
                newName = baseName + " - Copy " + copyNum;

            while (Directory.Exists(Path.Combine(collectionDir, newName)))
            {
                copyNum++;
                newName = baseName + " - Copy " + copyNum;
            }

            return newName;
        }