private string GetDestinationPath(string destinationRoot, string selectedProject)
{
if (!Directory.Exists(destinationRoot))
Directory.CreateDirectory(destinationRoot);
string path = destinationRoot + "\\" + Path.GetFileName(selectedProject);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
else
{
int index = 1;
while (Directory.Exists(path + index))
{
index++;
}
path = path + index;
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
}
return path;
}