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());
     }
 }
Exemple #2
0
        void OnLiveMatchViewModelRecieved(string jsLiveMatchViewModel)
        {
            LiveMatchViewModel liveMatchViewModel = jsLiveMatchViewModel.DeserializeFromJson <LiveMatchViewModel>();

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

            if (liveMatchViewModel == null)
            {
                return;
            }

            LiveMatchViewModelRecieved?.Invoke(this, liveMatchViewModel);
        }
Exemple #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()
            });
        }
 async void OnLiveViewMatchRecieved(object sender, LiveMatchViewModel liveMatchViewModel)
 {
     await SetOnMainThread(() => LiveMatchViewModel = liveMatchViewModel);
 }
 public DisplayLiveMatchViewModelDisplayComponentOptions(LiveMatchViewModel liveMatchViewModel)
 {
     LiveMatchViewModel = liveMatchViewModel;
 }