Dynamically get file system entries on tree expand only if we're of source FileSystem

dhcp-server
Pat Hartl 2023-09-10 23:28:33 -05:00
parent ca1520341c
commit 63df396fad
1 changed files with 13 additions and 10 deletions

View File

@ -287,18 +287,21 @@
async Task ExpandTree(TreeEventArgs<FileManagerDirectory> args)
{
var directory = (FileManagerDirectory)args.Node.DataItem;
foreach (var child in directory.Children)
if (Source == FileManagerSource.FileSystem)
{
var paths = Directory.EnumerateDirectories(child.Path, "*", new EnumerationOptions
{
IgnoreInaccessible = true,
RecurseSubdirectories = true,
MaxRecursionDepth = 1
});
var directory = (FileManagerDirectory)args.Node.DataItem;
child.PopulateChildren(paths);
foreach (var child in directory.Children)
{
var paths = Directory.EnumerateDirectories(child.Path, "*", new EnumerationOptions
{
IgnoreInaccessible = true,
RecurseSubdirectories = true,
MaxRecursionDepth = 1
});
child.PopulateChildren(paths);
}
}
}