private void SaveCurrentContent() { //MyData md = new MyData(); //md.Save(listView1.Items); ////SaveReadToFile.Serialize(listView1.Items); SaveReadToFile.Serialize(tournaments, @"..\..\tournaments.bin"); }
private void sprint100metresMen_Click(object sender, RoutedEventArgs e) { sprint100metresMen = new AthleticDiscipline(Disciplines.Sprint100Metres, Sex.Male); this.Discipline.Text = Disciplines.Sprint100Metres.ToString(); this.Gender.Text = Sex.Male.ToString(); if (null != (List <Athlete>)SaveReadToFile.Deserialize(@"..\..\athletesInTour.bin")) { athletesInTour = (List <Athlete>)SaveReadToFile.Deserialize(@"..\..\athletesInTour.bin"); for (int i = 0; i < athletesInTour.Count; i++) { ListAthlete.Items.Add(athletesInTour[i]); } } }
//public Make theme = new MakeDarkTheme(); public MainWindow() { InitializeComponent(); //var addTheme = theme.MakeTheme(); //string backgrounColour = addTheme.BackgrounColour; //string fontColour = addTheme.FontColour; atlets = new List <Athlete>(); tournaments = new List <Tournament>(); trainers = new List <Trainer>(); List <Athlete> tmp = (List <Athlete>)SaveReadToFile.Deserialize(@"..\..\atleti.bin"); List <Tournament> tmpTour = (List <Tournament>)SaveReadToFile.Deserialize(@"..\..\tournaments.bin"); List <Trainer> tmpTrainers = (List <Trainer>)SaveReadToFile.Deserialize(@"..\..\trainers.bin"); if (tmp != null) { atlets = (List <Athlete>)SaveReadToFile.Deserialize(@"..\..\atleti.bin"); } if (tmpTour != null) { tournaments = (List <Tournament>)SaveReadToFile.Deserialize(@"..\..\tournaments.bin"); } if (tmpTrainers != null) { trainers = (List <Trainer>)SaveReadToFile.Deserialize(@"..\..\trainers.bin"); } for (int i = 0; i < atlets.Count(); i++) { listViewAthlete.Items.Add(atlets[i]); } for (int i = 0; i < tournaments.Count(); i++) { listView1.Items.Add(tournaments[i]); } for (int i = 0; i < trainers.Count(); i++) { listViewTrainer.Items.Add(trainers[i]); } if (isFirstStart == true) { isFirstStart = false; ShowData(); } }
private void SaveDiscipline_Click(object sender, RoutedEventArgs e) { SaveReadToFile.Serialize(athletesInTour, @"..\..\athletesInTour.bin"); }
private void saveButton_ClickTrainer(object sender, RoutedEventArgs e) { SaveReadToFile.Serialize(trainers, @"..\..\trainers.bin"); }
private void saveButton_ClickAthlete(object sender, RoutedEventArgs e) { SaveReadToFile.Serialize(atlets, @"..\..\atleti.bin"); }