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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
 private void ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e)
 {
     RaisePropertyChanged("RankedClubs");
     /*if(CollectionChanged!=null)
         CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));*/
 }
Ejemplo n.º 5
0
 public RankingViewModel(Ranking ranking)
 {
     this._ranking = ranking;
     ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(ranking_NewMatchRegistered);
 }
Ejemplo n.º 6
0
 void _ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public RankingViewModel(Ranking ranking)
 {
     this._ranking = ranking;
 }
Ejemplo n.º 8
0
 void _ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e)
 {
     RaisePropertyChanged("RankedClubs");
 }
Ejemplo n.º 9
0
 private void ranking_NewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e)
 {
     matches.Add(e.NewMatch);
 }
Ejemplo n.º 10
0
 private void RankingOnNewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs matchRegistrationEventArgs)
 {
     RaisePropertyChanged("");
 }
Ejemplo n.º 11
0
 public MatchListViewModel(Ranking ranking)
 {
     matches = new ObservableCollection<Match>();
     ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(ranking_NewMatchRegistered);
 }
Ejemplo n.º 12
0
 public void RankingNewMatchRegistered(object sender, Ranking.MatchRegistrationEventArgs e)
 {
     _matches.Add(e.NewMatch);
 }
Ejemplo n.º 13
0
 public MatchListViewModel(Ranking ranking)
 {
     _ranking = ranking;
       _matches = new ObservableCollection<Match>();
       this._ranking.NewMatchRegistered += RankingNewMatchRegistered;
 }
Ejemplo n.º 14
0
 public MatchListViewModel(Ranking ranking)
 {
     throw new NotImplementedException();  
 }
Ejemplo n.º 15
0
 void _ranking_NewMatchRegistered(object sender,  Ranking.MatchRegistrationEventArgs e)
 {
     this.matches.Add(e.NewMatch);
 }
Ejemplo n.º 16
0
 public MatchListViewModel(Ranking ranking)
 {
     ranking.NewMatchRegistered += new EventHandler<Ranking.MatchRegistrationEventArgs>(_ranking_NewMatchRegistered);
 }