コード例 #1
0
        protected override void MatchTimeUpdated(int id)
        {
            base.MatchTimeUpdated(id);

            var m     = UoW.MatchRepo.GetMatchById(id);
            var match = ActualMatches.FirstOrDefault(m1 => m1.Id == id);

            if (match != null)
            {
                match.Time = m.Time;
            }
        }
コード例 #2
0
        protected override void NewEventAdded(int id)
        {
            base.NewEventAdded(id);

            var e = UoW.EventRepo.GetEventById(id);

            var match = ActualMatches.FirstOrDefault(m => m.Id == e.MatchId);

            if (match != null)
            {
                if (e.Type == EventType.G)
                {
                    if (e.TeamId == match.HomeTeamId)
                    {
                        match.ScoreH++;
                    }
                    else
                    {
                        match.ScoreA++;
                    }
                }
                match.Time = match.Time < e.Time ? e.Time : match.Time;
            }
        }