Esempio n. 1
0
 private void LoadGame(ReplayerDataModel value)
 {
     try
     {
         CurrentGame = value == null ? null : dataService.GetGame(value.GameNumber, value.PokersiteId);
         Update();
     }
     catch (Exception ex)
     {
         LogProvider.Log.Error(this, "Could not load game in replayer.", ex);
     }
 }
Esempio n. 2
0
        public void ReplayHand(Playerstatistic currentStat, IList <Playerstatistic> statistics, bool showHoleCards)
        {
            if (currentStat == null)
            {
                LogProvider.Log.Error(this, new ArgumentNullException(nameof(currentStat)));
                return;
            }

            if (statistics == null)
            {
                LogProvider.Log.Error(this, new ArgumentNullException(nameof(statistics)));
                return;
            }

            replayerDataModelList.ForEach(x => x.IsActive = false);

            var dataModelStatistic = new ReplayerDataModel(currentStat);

            var dataModel = replayerDataModelList.FirstOrDefault(x => x.Equals(dataModelStatistic));

            if (dataModel == null)
            {
                dataModelStatistic.IsActive = true;
                replayerDataModelList.Add(dataModelStatistic);
            }
            else
            {
                dataModel.IsActive = true;
                replayerDataModelList.Move(replayerDataModelList.IndexOf(dataModel), replayerDataModelList.Count - 1);
            }

            App.Current.Dispatcher.Invoke(() =>
            {
                var replayer       = new ReplayerView(replayerDataModelList, ReplayerHelpers.CreateSessionHandsList(statistics, currentStat), showHoleCards);
                replayer.IsTopmost = true;
                replayer.Show();
                replayer.IsTopmost = false;
            });
        }