Example #1
0
        public ViewerHumanLogic(P client, ViewerData data)
            : base(client, data)
        {
            TInfo = new TableInfoViewModel(_data.TInfo, _data.BackLink.GetSettings())
            {
                AnimateText = true, Enabled = true
            };

            TInfo.PropertyChanged += TInfo_PropertyChanged;
            TInfo.Ready           += TInfo_Ready;

            TInfo.MediaLoadError += TInfo_MediaLoadError;
        }
Example #2
0
        public ViewerHumanLogic(ViewerData data, ViewerActions viewerActions, ILocalizer localizer)
            : base(data)
        {
            _viewerActions = viewerActions;
            LO             = localizer;

            TInfo = new TableInfoViewModel(_data.TInfo, _data.BackLink.GetSettings())
            {
                AnimateText = true, Enabled = true
            };

            TInfo.PropertyChanged += TInfo_PropertyChanged;
            TInfo.Ready           += TInfo_Ready;

            TInfo.MediaLoadError += TInfo_MediaLoadError;
        }
Example #3
0
        //private readonly ViewerActions _viewerActions;
        //private readonly ViewerData _data;
        //private readonly ILocalizer _localizer;

        //public TableInfoViewModel TInfo { get; }

        public ShowmanHumanLogic(
            ViewerData data,
            TableInfoViewModel tableInfoViewModel,
            ViewerActions viewerActions,
            ILocalizer localizer)
            : base(data, viewerActions, localizer)
        {
            //_viewerActions = viewerActions;
            //_data = data;
            //_localizer = localizer;
            //TInfo = tableInfoViewModel;

            TInfo.QuestionSelected += PlayerClient_QuestionSelected;
            TInfo.ThemeSelected    += PlayerClient_ThemeSelected;

            TInfo.SelectQuestion.CanBeExecuted = false;
            TInfo.SelectTheme.CanBeExecuted    = false;
        }
Example #4
0
        private static void UpdateAnimation(TextBlock textBlock, TableInfoViewModel tableInfoViewModel)
        {
            if (System.Windows.Threading.Dispatcher.CurrentDispatcher != textBlock.Dispatcher)
            {
                textBlock.Dispatcher.Invoke((Action <TextBlock, TableInfoViewModel>)UpdateAnimation, textBlock, tableInfoViewModel);
                return;
            }

            if (tableInfoViewModel.TextLength > CurrentTarget)
            {
                var animation = new Int32Animation
                {
                    To       = tableInfoViewModel.TextLength,
                    Duration = new Duration(TimeSpan.FromSeconds((tableInfoViewModel.TextLength - CurrentTarget) * tableInfoViewModel.TextSpeed))
                };

                textBlock.TextEffects[0].BeginAnimation(TextEffect.PositionCountProperty, animation);

                CurrentTarget = tableInfoViewModel.TextLength;
            }
        }
Example #5
0
        public RemoteGameUI()
        {
            TInfo = new TableInfoViewModel {
                Enabled = true
            };

            TInfo.TStage           = TableStage.Sign;
            TInfo.PropertyChanged += TInfo_PropertyChanged;
            TInfo.Ready           += TInfo_Ready;

            TInfo.QuestionSelected += QuestionInfo_Selected;
            TInfo.ThemeSelected    += ThemeInfo_Selected;

            Next = new SimpleCommand(arg => { if (_gameHost != null)
                                              {
                                                  _gameHost.AskNext();
                                              }
                                     });
            Back = new SimpleCommand(arg => { if (_gameHost != null)
                                              {
                                                  _gameHost.AskBack();
                                              }
                                     });
            NextRound = new SimpleCommand(arg => { if (_gameHost != null)
                                                   {
                                                       _gameHost.AskNextRound();
                                                   }
                                          });
            BackRound = new SimpleCommand(arg => { if (_gameHost != null)
                                                   {
                                                       _gameHost.AskBackRound();
                                                   }
                                          });
            Stop = new SimpleCommand(arg => { if (_gameHost != null)
                                              {
                                                  _gameHost.AskStop();
                                              }
                                     });
        }