static public string UniqueFile(string path, PathCaseComparison caseComparison) { if (!IsValidPath(path)) { throw new ArgumentException(); } if (IsExplicitFolderPath(path)) { throw new ArgumentException(); } // Normalize path = Normalize(path); // Change case if necessary return(PathComparer.ApplyCaseComparison(Normalize(path), caseComparison)); }
static public string UniqueFolder(string path, PathCaseComparison caseComparison) { if (!IsValidPath(path)) { throw new ArgumentException(); } // Normalize path = Normalize(path, out char separator); // Change case if necessary path = PathComparer.ApplyCaseComparison(path, caseComparison); // Add end separator if (!IsExplicitFolderPath(path, separator)) { path += separator; } return(path); }