public MainWindow() { InitializeComponent(); string[] clubnames ={ "AC Ajaccio", "AS Nancy-Lorraine" , "AS Saint-Etienne", "ESTAC Troyes", "Evian TG FC", "FC Lorient", "FC Sochaux-Montbéliard", "Girondins de Bordeaux", "LOSC Lille", "Montpellier Hérault SC", "OGC Nice", "Olympique de Marseille", "Olympique Lyonnais", "Paris Saint-Germain", "SC Bastia", "Stade Brestois 29", "Stade de Reims", "Stade Rennais FC", "Toulouse FC", "Valenciennes FC" }; List<Club> clubs = new List<Club>(); foreach (string clubname in clubnames) clubs.Add(new Club(clubname)); Ranking ranking = new Ranking(new FrenchLeague1PointSystem(), clubs.ToArray()); this.matchEditView.DataContext = new ViewModel.MatchViewModel(clubs, ranking); this.rankingView.DataContext = new ViewModel.RankingViewModel(ranking); }
public MatchViewModel(IEnumerable<Club> clubs, Ranking ranking) { this._clubs = clubs; this._home = clubs.ElementAt(0); this._away = clubs.ElementAt(1); this._ranking = ranking; this._hgoals = this._agoals = 0; }
static void Main(string[] args) { Club fcgb=new Club("FCGB"); Club psg =new Club("PSG"); Ranking ranking = new Ranking(FrenchLeague1PointSystem.Instance, new Club[] { fcgb, psg }); ranking.Register(new Match(fcgb, psg, 2, 0)); ranking.Register(new Match(psg, fcgb, 3, 0)); for (int i = 0; i < 2; i++) Console.WriteLine("{0} : {1}", ranking.GetClub(i), ranking.GetPoints(i)); }
private void ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { RaisePropertyChanged("RankedClubs"); /*if(CollectionChanged!=null) CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));*/ }
public RankingViewModel(Ranking ranking) { this._ranking = ranking; ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(ranking_NewMatchRegistered); }
void _ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { throw new NotImplementedException(); }
public RankingViewModel(Ranking ranking) { this._ranking = ranking; }
void _ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { RaisePropertyChanged("RankedClubs"); }
private void ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { matches.Add(e.NewMatch); }
private void RankingOnNewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs matchRegistrationEventArgs) { RaisePropertyChanged(""); }
public MatchListViewModel(Ranking ranking) { matches = new ObservableCollection<Match>(); ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(ranking_NewMatchRegistered); }
public void RankingNewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { _matches.Add(e.NewMatch); }
public MatchListViewModel(Ranking ranking) { _ranking = ranking; _matches = new ObservableCollection<Match>(); this._ranking.NewMatchRegistered += RankingNewMatchRegistered; }
public MatchListViewModel(Ranking ranking) { throw new NotImplementedException(); }
void _ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e) { this.matches.Add(e.NewMatch); }
public MatchListViewModel(Ranking ranking) { ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(_ranking_NewMatchRegistered); }