AsposeVisualStudioPluginCells.GUI.SampleWizardPage.GetDestinationPath C# (CSharp) Method

GetDestinationPath() private method

private GetDestinationPath ( string destinationRoot, string selectedProject ) : string
destinationRoot string
selectedProject string
return string
        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;
        }