Files
winui3-learning/winui-learning/winui-learning-3/Models/FolderContentDto.cs
T
2026-10-13 20:56:25 +02:00

21 lines
601 B
C#

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
namespace winui_learning_3.Models;
public class FolderContentDto
{
public required string AbsolutePath { get; set; }
public ObservableCollection<FolderContentDto> Children { get; set; } = [];
public List<FileDto> Files { get; set; } = [];
public string Name
{
get
{
var name = Path.GetFileName(AbsolutePath.TrimEnd(Path.DirectorySeparatorChar));
return string.IsNullOrEmpty(name) ? AbsolutePath : name; // "C:\" has no file name
}
}
}