示例#1
0
        private void updateRacerList()
        {
            //clear list holders
            tileHolder.Children.Clear();
            listHolder.Children.Clear();

            if (btnTileMode.IsChecked.HasValue && btnTileMode.IsChecked.Value)           //deside which mode to display
            {
                if (btnShowClasses.IsChecked.HasValue && btnShowClasses.IsChecked.Value) //deside to show classes
                {
                    foreach (KeyValuePair <string, List <Racer> > racer in sortRacerIntoClasses())
                    {
                        listGroup group = new listGroup();
                        group.Title.Content = racer.Key;
                        createCarTiles(group.tileHolder, racer.Value);
                        tileHolder.Children.Add(group);
                    }
                }
                else
                {
                    createCarTiles(tileHolder, DataManager.Competition.Racers);
                }
            }
            else
            {
                if (btnShowClasses.IsChecked.HasValue && btnShowClasses.IsChecked.Value)//deside to show classes
                {
                    foreach (KeyValuePair <string, List <Racer> > racer in sortRacerIntoClasses())
                    {
                        listGroup group = new listGroup();
                        group.Title.Content = racer.Key;
                        createCarList(group.listHolder, racer.Value);
                        listHolder.Children.Add(group);
                    }
                }
                else
                {
                    createCarList(listHolder, DataManager.Competition.Racers);
                }
            }
        }
示例#2
0
 private void updateRacerList()
 {
     //clear list holders
     tileHolder.Children.Clear();
     listHolder.Children.Clear();
     
     if (btnTileMode.IsChecked.HasValue && btnTileMode.IsChecked.Value)//deside which mode to display
     {
         if (btnShowClasses.IsChecked.HasValue && btnShowClasses.IsChecked.Value)//deside to show classes
         {
             foreach (KeyValuePair<string, List<Racer>> racer in sortRacerIntoClasses())
             {
                 listGroup group = new listGroup();
                 group.Title.Content = racer.Key;
                 createCarTiles(group.tileHolder, racer.Value);
                 tileHolder.Children.Add(group);
             }
         }
         else
         {
             createCarTiles(tileHolder, DataManager.Competition.Racers);
         }
     }
     else
     {
         if (btnShowClasses.IsChecked.HasValue && btnShowClasses.IsChecked.Value)//deside to show classes
         {
             foreach (KeyValuePair<string, List <Racer>> racer in sortRacerIntoClasses())
             {
                 listGroup group = new listGroup();
                 group.Title.Content = racer.Key;
                 createCarList(group.listHolder, racer.Value);
                 listHolder.Children.Add(group);
             }
         }
         else
         {
             createCarList(listHolder, DataManager.Competition.Racers);
         }
     }
 }