Exemple #1
0
        private void GearDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (GearDataGrid.SelectedIndex == -1)
            {
                Close();
                return;
            }

            Choice = (GearSaves)GearDataGrid.SelectedItem;
            Close();
        }
Exemple #2
0
        public List <GearSaves> LoadeGearset()
        {
            List <GearSaves> output = new List <GearSaves>();

            string PathX = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), App.ToolBin, "Gearsets");

            if (!Directory.Exists(PathX))
            {
                System.Windows.MessageBox.Show("Could not find CMTool/Gearsets Directory: " + PathX);
                return(output);
            }

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

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

            return(output);
        }
        public List <GearSaves> LoadeGearset()
        {
            List <GearSaves> output = new List <GearSaves>();

            string PathX = SaveSettings.Default.GearsetsDirectory;

            if (!Directory.Exists(PathX))
            {
                System.Windows.MessageBox.Show("Could not find CMTool/Gearsets Directory: " + PathX);
                return(output);
            }

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

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

            return(output);
        }