Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }