Exemplo n.º 1
0
 private static void parseDBData(DBData dbData)
 {
     TST = dbData.TST;
     TSTOpp = dbData.TSTOpp;
     PST = dbData.PST;
     SeasonTeamRankings = dbData.SeasonTeamRankings;
     PlayoffTeamRankings = dbData.PlayoffTeamRankings;
     SplitTeamStats = dbData.SplitTeamStats;
     SplitPlayerStats = dbData.SplitPlayerStats;
     SeasonPlayerRankings = dbData.SeasonPlayerRankings;
     PlayoffPlayerRankings = dbData.PlayoffPlayerRankings;
     DisplayNames = dbData.DisplayNames;
     BSHist = dbData.BSHist;
 }
Exemplo n.º 2
0
        public static async Task UpdateAllData(bool leaveProgressWindowOpen = false, bool onlyPopulate = false)
        {
            MWInstance.startProgressWatchTimer();
            var dbData = new DBData();
            dbData = await Task.Run(() => SQLiteIO.PopulateAll(Tf));
            parseDBData(dbData);
            if (onlyPopulate)
            {
                return;
            }
            GameLength = SQLiteIO.GetSetting("Game Length", 48);
            SeasonLength = SQLiteIO.GetSetting("Season Length", 82);
            NumberOfPeriods = SQLiteIO.GetSetting("NumberOfPeriods", 4);
            ShotClockDuration = SQLiteIO.GetSetting("Shot Clock Duration", 24);

            Interlocked.Exchange(ref ProgressHelper.Progress, new ProgressInfo(ProgressHelper.Progress, "Updating notables..."));
            //MessageBox.Show(SQLiteIO.Progress.CurrentStage.ToString());
            updateNotables();
            Interlocked.Exchange(ref ProgressHelper.Progress, new ProgressInfo(ProgressHelper.Progress, "Updating search cache..."));
            MWInstance.UpdateSearchCache();

            if (_notables.Count > 0)
            {
                MWInstance._marqueeTimer.Start();
            }

            MWInstance.mnuTools.IsEnabled = true;
            MWInstance.grdAnalysis.IsEnabled = true;
            MWInstance.grdUpdate.IsEnabled = true;

            if (!leaveProgressWindowOpen)
            {
                MWInstance.StopProgressWatchTimer();
                MWInstance.IsEnabled = true;
            }

            MWInstance.UpdateStatus(String.Format("{0} teams & {1} players loaded successfully!", TST.Count, PST.Count));
            LoadingSeason = false;
            MWInstance.mainGrid.Visibility = Visibility.Visible;
        }