public MainWindow() { //init collections this.FinishedSaving = true; this.DailyGoldBalances = new ObservableCollection <DailyGoldBalance>(); this.DailySlayerTasks = new ObservableCollection <DailySlayerTaskList>(); this.DailyTimeStatistics = new ObservableCollection <DailyTimeStatistic>(); //init windows this.InitializeComponent(); this.ApplicationInit(); //init databases Slayer.InitSlayerTables(); Earnings.InitItemNames(); //load collection items this.LoadTasks(); this.LoadBalances(); this.LoadTimeStatistics(); this.InitTimeStatistics(); //init the views this.goldBalancePage.PopulateViews(); //ALWAYS BACK UP YOUR WORK KIDDOS this.MakeFilesBackup(); GC.Collect(); this.UpdateOwners(); //this.inGameTimePage.DrawChart(); }
/// <summary> /// saves current progress /// </summary> private void SaveAllProgress() { (new Thread(() => Earnings.DumpToDisk())).Start(); Parallel.ForEach(DailyGoldBalances, element => element.SaveToJson()); Parallel.ForEach(DailySlayerTasks, element => element.SaveToJson()); Parallel.ForEach(DailyTimeStatistics, element => element.SaveToJson()); MessageBox.Show("Progress saved successfully!", "Saving", MessageBoxButton.OK); }