Skip to content

Commit 4358303

Browse files
committed
make IsCsprojRootFolder a computed property
1 parent 1c568b4 commit 4358303

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/SharpIDE.Application/Features/FileSystem/SharpIdeRootFolder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public SharpIdeRootFolder(DirectoryInfo folderInfo)
1919

2020
Path = folderInfo.FullName;
2121
Name = new ReactiveProperty<string>(folderInfo.Name);
22-
IsCsprojRootFolder = false; // TODO: Could be true
2322
Parent = null!;
2423

2524
Files = new ObservableList<SharpIdeFile>(folderInfo.GetFiles(this, allFiles));

src/SharpIDE.Application/Features/SolutionDiscovery/SharpIdeFolder.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class SharpIdeFolder : ISharpIdeNode, IExpandableSharpIdeNode, IChildShar
1212
public required string Path { get; set; }
1313
public string ChildNodeBasePath => Path;
1414
public required ReactiveProperty<string> Name { get; set; }
15-
public required bool IsCsprojRootFolder { get; set; }
15+
public bool IsCsprojRootFolder => Files.Any(f => f.Extension.Equals(".csproj", StringComparison.OrdinalIgnoreCase));
1616
public ObservableList<SharpIdeFile> Files { get; set; } = null!;
1717
public ObservableList<SharpIdeFolder> Folders { get; set; } = null!;
1818
public bool Expanded { get; set; }
@@ -25,7 +25,6 @@ public SharpIdeFolder(DirectoryInfo folderInfo, IExpandableSharpIdeNode parent,
2525
Name = new ReactiveProperty<string>(folderInfo.Name);
2626
Files = new ObservableList<SharpIdeFile>(folderInfo.GetFiles(this, allFiles));
2727
Folders = new ObservableList<SharpIdeFolder>(this.GetSubFolders(this, allFiles, allFolders));
28-
IsCsprojRootFolder = Files.Any(s => s.Extension.Equals(".csproj", StringComparison.OrdinalIgnoreCase));
2928
}
3029

3130
public SharpIdeFolder()

0 commit comments

Comments
 (0)