add new file and dir to project

This commit is contained in:
Matt Parker
2025-10-20 20:15:45 +10:00
parent e2f9829aa0
commit a62468123e
8 changed files with 36 additions and 18 deletions

View File

@@ -13,9 +13,9 @@ public class SharpIdeSolutionModificationService(FileChangedService fileChangedS
public SharpIdeSolutionModel SolutionModel { get; set; } = null!;
/// The directory must already exist on disk
public async Task<SharpIdeFolder> AddDirectory(SharpIdeFolder parentFolder, string directoryName)
public async Task<SharpIdeFolder> AddDirectory(IFolderOrProject parentFolder, string directoryName)
{
var addedDirectoryPath = Path.Combine(parentFolder.Path, directoryName);
var addedDirectoryPath = Path.Combine(parentFolder.ChildNodeBasePath, directoryName);
var allFiles = new ConcurrentBag<SharpIdeFile>();
var allFolders = new ConcurrentBag<SharpIdeFolder>();
var sharpIdeFolder = new SharpIdeFolder(new DirectoryInfo(addedDirectoryPath), parentFolder, allFiles, allFolders);