private Model.Models.Tournament CreateDesignTimeVm() { #region Dummy PlayAreas var playAreas = new List <Model.Models.PlayArea>(); playAreas.Add(new Model.Models.PlayArea(1, "Area 1", "Play Area 1")); playAreas.Add(new Model.Models.PlayArea(1, "Area 2", "Play Area 2")); #endregion #region Dummy Teams var teams = new List <Model.Models.Team>(); teams.Add(new Model.Models.Team(1, "Team 1")); teams.Add(new Model.Models.Team(2, "Team 2")); teams.Add(new Model.Models.Team(3, "Team 3")); teams.Add(new Model.Models.Team(4, "Team 4")); teams.Add(new Model.Models.Team(5, "Team 5")); teams.Add(new Model.Models.Team(6, "Team 6")); teams.Add(new Model.Models.Team(7, "Team 7")); teams.Add(new Model.Models.Team(8, "Team 8")); #endregion var finalMatch = new Model.Models.Match(1, new Model.Models.Team(1, "Team 1"), new Model.Models.Team(2, "Team 2"), playAreas[0], DateTime.Now, DateTime.Now.AddMinutes(60), null, null, 2, null, null, null, null); var tournament = new Model.Models.Tournament(1, "Ping-Pong", "nur die Harten kommen in den Garten...", DateTime.Now, 60, 8, 1, playAreas, teams, finalMatch); return(tournament); }
internal MatchViewModel GetMatchViewModel(Model.Models.Tournament tournament, Model.Models.Match match, MatchViewModel successor) { MatchViewModel matchViewModel; if (!_matches.TryGetValue(match.Id.Value, out matchViewModel)) { matchViewModel = new MatchViewModel(tournament, match, successor); _matches.Add(match.Id.Value, matchViewModel); } return(matchViewModel); }