Пример #1
0
 public async Task SendMatchUpdate(LiveMatchStats liveMatchStats)
 {
     if (liveMatchStats != null && currentFootballMatch != null)
     {
         LiveMatchViewModel liveMatchViewModel = new LiveMatchViewModel(currentFootballMatch, liveMatchStats);
         await hubContextMatchHub.Clients.All.SendAsync(Variables.SignalRMethodName_LiveMatch, liveMatchViewModel.SerializeToJson());
     }
 }
Пример #2
0
        void OnLiveMatchViewModelRecieved(string jsLiveMatchViewModel)
        {
            LiveMatchViewModel liveMatchViewModel = jsLiveMatchViewModel.DeserializeFromJson <LiveMatchViewModel>();

            if (liveMatchViewModel != null)
            {
                OnLiveMatchView?.Invoke(this, liveMatchViewModel);
            }
        }
Пример #3
0
        private void ProcessLiveMatchViewModel(string jsLiveMatchViewModel)
        {
            LiveMatchViewModel liveMatchViewModel = jsLiveMatchViewModel?.DeserializeFromJson <LiveMatchViewModel>();

            if (liveMatchViewModel == null)
            {
                return;
            }

            LiveMatchViewModelRecieved?.Invoke(this, liveMatchViewModel);
        }
Пример #4
0
        public static ProtoMessageLiveMatchViewModel Map(LiveMatchViewModel liveMatchViewModel)
        {
            if (liveMatchViewModel == null)
            {
                return(null);
            }

            return(new ProtoMessageLiveMatchViewModel()
            {
                AwayTeamLogo = liveMatchViewModel.AwayTeamLogo,
                HomeTeamLogo = liveMatchViewModel.HomeTeamLogo,
                AwayTeamName = liveMatchViewModel.AwayTeamName,
                GoalsAwayTeam = liveMatchViewModel.GoalsAwayTeam,
                GoalsHomeTeam = liveMatchViewModel.GoalsHomeTeam,
                HomeTeamName = liveMatchViewModel.HomeTeamName,
                MatchId = liveMatchViewModel.MatchId,
                MatchStatus = liveMatchViewModel.MatchStatus,
                Minute = liveMatchViewModel.Minute,
                PenaltiesScoredAwayTeam = liveMatchViewModel.PenaltiesScoredAwayTeam,
                PenaltiesScoredHomeTeam = liveMatchViewModel.PenaltiesScoredHomeTeam,
                StartTime = liveMatchViewModel.StartTime.ToString()
            });
        }
Пример #5
0
 async void OnLiveViewMatchRecieved(object sender, LiveMatchViewModel liveMatchViewModel)
 {
     await SetOnMainThread(() => LiveMatchViewModel = liveMatchViewModel);
 }
 public DisplayLiveMatchViewModelDisplayComponentOptions(LiveMatchViewModel liveMatchViewModel)
 {
     LiveMatchViewModel = liveMatchViewModel;
 }