Drag-Drop-Move
This commit is contained in:
.vscode
Drag-Drop-Move
.vscode
Drag-Drop-Move.csprojDragDropMove.Designer.csDragDropMove.csModels
Program.csappsettings.Development.jsonappsettings.jsonInstance
Map/Models
Metadata/Models/Stateless/Methods
Shared/Models/Stateless/Methods
View-by-Distance-MKLink-Console.sln@ -138,6 +138,27 @@ internal abstract class XPath
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static List<string> GetDirectories(string directory)
|
||||
{
|
||||
List<string> results = new();
|
||||
string? checkDirectory = directory;
|
||||
string? pathRoot = Path.GetPathRoot(directory);
|
||||
if (string.IsNullOrEmpty(pathRoot))
|
||||
throw new NullReferenceException(nameof(pathRoot));
|
||||
if (Directory.Exists(directory))
|
||||
results.Add(directory);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
||||
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
||||
break;
|
||||
results.Add(checkDirectory);
|
||||
}
|
||||
results.Add(pathRoot);
|
||||
results.Reverse();
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static (int level, List<string> directories) Get(string rootDirectory, string sourceDirectory)
|
||||
{
|
||||
int result = 0;
|
||||
|
Reference in New Issue
Block a user