コード例 #1
0
 private void CompetitionsEdit(KindOfSport kindOfSport)
 {
     kindOfSport.MostFamousCompetitions.Clear();
     for (var i = 0; i < competitionsListBox.SelectedItems.Count; i++)
     {
         kindOfSport.MostFamousCompetitions.Add(competitionsListBox.SelectedItems[i].ToString());
     }
 }
コード例 #2
0
 private void CompetitionsOutput(KindOfSport kindOfSport)
 {
     foreach (var competition in kindOfSport.MostFamousCompetitions)
     {
         for (var i = 0; i < competitionsListBox.Items.Count; i++)
         {
             if (competition == competitionsListBox.Items[i].ToString())
             {
                 competitionsListBox.SetSelected(i, true);
             }
         }
     }
 }
コード例 #3
0
 private void AddKindOfSportToTrees(KindOfSport kindOfSport)
 {
     if (kindOfSport is Fight)
     {
         treeOfSport.Nodes[0].Nodes[1].Nodes[1].Nodes.Add(new TreeNode((kindOfSport as Fight).Name));
     }
     else if (kindOfSport is BallGame)
     {
         treeOfSport.Nodes[0].Nodes[1].Nodes[0].Nodes.Add(new TreeNode((kindOfSport as BallGame).Name));
     }
     else if (kindOfSport is MindSport)
     {
         treeOfSport.Nodes[0].Nodes[0].Nodes.Add(new TreeNode((kindOfSport as MindSport).Name));
     }
     else if (kindOfSport is OtherBodySport)
     {
         treeOfSport.Nodes[0].Nodes[1].Nodes[2].Nodes.Add(new TreeNode((kindOfSport as OtherBodySport).Name));
     }
 }