예제 #1
0
        private DVARList LoadDvarLists()
        {
            string[] folders  = Directory.GetDirectories(JSONPath);
            DVARList dvarList = new DVARList();

            foreach (string folderPath in folders)
            {
                Game game = new Game();
                game.GameName = Path.GetFileNameWithoutExtension(folderPath);;
                string[] files = Directory.GetFiles(folderPath, "*.json");
                foreach (string filePath in files)
                {
                    var commands = JsonConvert.DeserializeObject <List <Command> >(File.ReadAllText(filePath));
                    if (game.Commands != null)
                    {
                        game.Commands.Concat(commands);
                    }
                    else
                    {
                        game.Commands = commands.ToList();
                    }
                }
                if (dvarList.Games == null)
                {
                    dvarList.Games = new List <Game>();
                }

                dvarList.Games.Add(game);
            }
            return(dvarList);
        }
예제 #2
0
 private void uc_Search_Load(object sender, EventArgs e)
 {
     LoadSelectedDvarList();
     DvarLists = LoadDvarLists();
 }