public void UpdateList(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist) { wle = _wle; wllist = _wllist; IEqualityComparer<worldDriverProfile> wdpc = new worldDriverProfileComparer(); IEqualityComparer<worldCars> wcc = new worldCarsComparer(); var plist = new List<string>(); foreach (string str in personas.CheckedItems) { plist.Add(str); } personas.Tag = plist; var elist = new List<string>(); foreach (string str in events.CheckedItems) { elist.Add(str); } events.Tag = elist; var emlist = new List<string>(); foreach (string str in eventmodes.CheckedItems) { emlist.Add(str); } eventmodes.Tag = emlist; var clist = new List<string>(); foreach (string str in cars.CheckedItems) { clist.Add(str); } cars.Tag = clist; personas.Items.Clear(); events.Items.Clear(); eventmodes.Items.Clear(); cars.Items.Clear(); personas.Items.AddRange(wllist.Select(x => x.persona.DriverProfile).Distinct(wdpc).OrderBy(x => x.name).Select(x => x.name).ToArray<string>()); events.Items.AddRange(wle.Events.OrderBy(x => x.eventName).Select(x => x.eventName).ToArray<string>()); eventmodes.Items.AddRange(wle.Events.Select(x => getEventModeName(x.eventModeId)).Distinct().ToArray<string>()); cars.Items.AddRange(wllist.Select(x => x.car).Distinct(wcc).OrderBy(x => (x.make + " " + x.carName)).Select(x => (x.make + " " + x.carName)).ToArray<string>()); var arr = new[] { personas, events, eventmodes, cars }; foreach (CheckedListBox o in arr) { for (int i = 0; i < o.Items.Count; i++) { o.SetItemChecked(i, (o.Tag as List<string>).Contains(o.Items[i])); } } //fromDate.Value = wllist.Min(x => x.createdDate.dateTime).Date; //toDate.Value = wllist.Max(x => x.createdDate.dateTime).Date; dataGridView1.DataSource = getFilteredList(); }
private void loadFromXml() { if (File.Exists(strDownloadPath + "\\worldleaderboardevents.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardevents.xml"); wle = (SeDes.ToObj(xml, wle) as worldLeaderboardEvents); } else { wle.Events = new List <Event>(); } twle.Events = new List <Event>(); if (File.Exists(strDownloadPath + "\\worldleaderboardlist.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardlist.xml"); wllist = (SeDes.ToObj(xml, wllist) as List <worldLeaderboards>); } if (File.Exists(strDownloadPath + "\\drivers.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\drivers.xml"); drivers = (SeDes.ToObj(xml, drivers) as List <Driver>); } }
public ViewEvents(worldLeaderboardEvents _wle,worldLeaderboardEvents _twle) { InitializeComponent(); wle = _wle; twle = _twle; }
public ListChangeEventArgs(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist, List <Driver> _drivers) { wle = _wle; wllist = _wllist; drivers = _drivers; }
public void UpdateList(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist) { wle = _wle; wllist = _wllist; IEqualityComparer <worldDriverProfile> wdpc = new worldDriverProfileComparer(); IEqualityComparer <worldCars> wcc = new worldCarsComparer(); var plist = new List <string>(); foreach (string str in personas.CheckedItems) { plist.Add(str); } personas.Tag = plist; var elist = new List <string>(); foreach (string str in events.CheckedItems) { elist.Add(str); } events.Tag = elist; var emlist = new List <string>(); foreach (string str in eventmodes.CheckedItems) { emlist.Add(str); } eventmodes.Tag = emlist; var clist = new List <string>(); foreach (string str in cars.CheckedItems) { clist.Add(str); } cars.Tag = clist; personas.Items.Clear(); events.Items.Clear(); eventmodes.Items.Clear(); cars.Items.Clear(); personas.Items.AddRange(wllist.Select(x => x.persona.DriverProfile).Distinct(wdpc).OrderBy(x => x.name).Select(x => x.name).ToArray <string>()); events.Items.AddRange(wle.Events.OrderBy(x => x.eventName).Select(x => x.eventName).ToArray <string>()); eventmodes.Items.AddRange(wle.Events.Select(x => getEventModeName(x.eventModeId)).Distinct().ToArray <string>()); cars.Items.AddRange(wllist.Select(x => x.car).Distinct(wcc).OrderBy(x => (x.make + " " + x.carName)).Select(x => (x.make + " " + x.carName)).ToArray <string>()); var arr = new[] { personas, events, eventmodes, cars }; foreach (CheckedListBox o in arr) { for (int i = 0; i < o.Items.Count; i++) { o.SetItemChecked(i, (o.Tag as List <string>).Contains(o.Items[i])); } } //fromDate.Value = wllist.Min(x => x.createdDate.dateTime).Date; //toDate.Value = wllist.Max(x => x.createdDate.dateTime).Date; dataGridView1.DataSource = getFilteredList(); }
public ViewData(worldLeaderboardEvents _wle, List <worldLeaderboards> _wllist) { InitializeComponent(); wle = _wle; wllist = _wllist; }
public ViewData(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist) { InitializeComponent(); wle = _wle; wllist = _wllist; }
private void loadFromXml() { if (File.Exists(strDownloadPath + "\\worldleaderboardevents.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardevents.xml"); wle = (SeDes.ToObj(xml, wle) as worldLeaderboardEvents); } else { wle.Events = new List<Event>(); } twle.Events = new List<Event>(); if (File.Exists(strDownloadPath + "\\worldleaderboardlist.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\worldleaderboardlist.xml"); wllist = (SeDes.ToObj(xml, wllist) as List<worldLeaderboards>); } if (File.Exists(strDownloadPath + "\\drivers.xml")) { string xml = File.ReadAllText(strDownloadPath + "\\drivers.xml"); drivers = (SeDes.ToObj(xml, drivers) as List<Driver>); } }
public ViewEvents(worldLeaderboardEvents _wle, worldLeaderboardEvents _twle) { InitializeComponent(); wle = _wle; twle = _twle; }
public ListChangeEventArgs(worldLeaderboardEvents _wle, List<worldLeaderboards> _wllist,List<Driver> _drivers) { wle = _wle; wllist = _wllist; drivers = _drivers; }