예제 #1
0
        public MainWindow()
        {
            var config = Serialization.LoadMain(ConfigPath);

            if (config == null)
            {
                config          = new MainConfig();
                config.Projects = new List <ProjectListing>();
                config.Guids    = new List <GuidEntry>();
                int xl = Serialization.BaseGuids.Length;
                for (int i = 0; i < xl; i++)
                {
                    var set = Serialization.BaseGuids[i];
                    config.Guids.Add(new GuidEntry()
                    {
                        Modified = set[0], Retail = set[1], Name = set[2]
                    });
                }

                Serialization.SaveMain(ConfigPath, config);
            }

            //GuidGrid.DataContext = Config.Guids;

            Config           = new ConfigViewModel(config);
            this.DataContext = Config;

            InitializeComponent();

            ProjectList.ItemsSource       = Config.Projects;
            ProjectList.SelectionChanged += ProjectList_SelectionChanged;

            var d = config.Guids[0];
        }
예제 #2
0
 public static void SaveMain(string path, MainConfig config) => SaveObject(path, config);