コード例 #1
0
        private void CharDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (CharDataGrid.SelectedIndex == -1)
            {
                Close();
                return;
            }

            Choice = (CharSaves)CharDataGrid.SelectedItem;
            Close();
        }
コード例 #2
0
        public List <CharSaves> LoadCharSet()
        {
            List <CharSaves> output = new List <CharSaves>();

            var PathX = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "SSTool", "Saves");

            if (!Directory.Exists(PathX))
            {
                MessageBox.Show("Could not find SSTool/Saves Directory: " + PathX);
                return(output);
            }

            var files = Directory.GetFiles(PathX, "*.json*");

            foreach (var file in files)
            {
                CharSaves load = JsonConvert.DeserializeObject <CharSaves>(File.ReadAllText(file));
                output.Add(load);
            }

            return(output);
        }