public static BonsaiCommandList <T> ReadBonsaiCommands <T>() where T : BonsaiCommand, new() { var filer = new FileService(); var projectName = new ProjectReaderRepository(new FileService()).GetProjectName(); var commandString = filer.ReadFromFile($"../{projectName}/Command.json"); var fileCommand = JsonConvert.DeserializeObject <BonsaiCommandList <T> >(commandString); return(fileCommand); }
public static BonsaiCommandList <T> GetBonsiaCommandList <T>() where T : BonsaiCommand, new() { var commandList = YourBonsaiCommand <T>(); var filer = new FileService(); var projectName = new ProjectReaderRepository(new FileService()).GetProjectName(); filer.WriteFileToDisk($"../{projectName}/Command.json", commandList.SerializeObject()); return(commandList); }