示例#1
0
        private void RefreshStats(Expression <Func <GameResult, bool> > filter = null)
        {
            var expr = filter ?? GetFilterExpression();

            Task.Run(() => CurrentStats.RefreshFrom(dbContext, expr));
            Task.Run(() => this.totals.Update(dbContext, expr));
        }
示例#2
0
        private void RefreshStats(Expression <Func <ArenaSession, bool> > filter = null)
        {
            needStatsRefresh = true;
            var expr = filter ?? GetFilterExpression();

            Application.Current.Dispatcher.BeginInvoke(
                (Action)(() =>
            {
                if (needStatsRefresh)
                {
                    needStatsRefresh = false;
                    Task.Run(() => totals.Update(dbContext, expr));
                    Task.Run(() => CurrentStats.RefreshFrom(dbContext, expr));
                }
            }), DispatcherPriority.ContextIdle);
        }