using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; using ObservableCollections; using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; namespace SharpIDE.Application.Features.SolutionDiscovery; public class SharpIdeFolder : ISharpIdeNode, IExpandableSharpIdeNode, IChildSharpIdeNode, IFolderOrProject { public required IExpandableSharpIdeNode Parent { get; set; } public required string Path { get; set; } public string ChildNodeBasePath => Path; public required string Name { get; set; } public ObservableHashSet Files { get; init; } public ObservableHashSet Folders { get; init; } public bool Expanded { get; set; } [SetsRequiredMembers] public SharpIdeFolder(DirectoryInfo folderInfo, IExpandableSharpIdeNode parent, ConcurrentBag allFiles, ConcurrentBag allFolders) { Parent = parent; Path = folderInfo.FullName; Name = folderInfo.Name; Files = new ObservableHashSet(folderInfo.GetFiles(this, allFiles)); Folders = new ObservableHashSet(this.GetSubFolders(this, allFiles, allFolders)); } public SharpIdeFolder() { } }