public frmRaceResults(Race race) { InitializeComponent(); this.rdf = new RRDataFetcher(); string title; if (race.RaceName != null) { title = race.RaceName + " (" + race.Track.Name + ")"; } else { title = race.Track.Name; } this.lblRace.Text = race.RaceDate.ToShortDateString() + ", " + title; Race r = Task.Run(() => this.rdf.GetRaceDetailsAsync(race)).Result; List <RaceResult> raceResults = (from rr in r.RaceResults orderby rr.FinishPosition ascending select rr).ToList(); this.bsRaceResults.DataSource = raceResults; this.race = r; if (this.race.LoopDatas == null || this.race.LoopDatas.Count == 0) { this.butLoopData.Enabled = false; } if (this.race.PitStopDatas == null || this.race.PitStopDatas.Count == 0) { this.butPitStopData.Enabled = false; } }
public frmPitStopData(Race race) { InitializeComponent(); string title; if (race.RaceName != null) { title = race.RaceName + " (" + race.Track.Name + ")"; } else { title = race.Track.Name; } this.lblRace.Text = "PitStopData for " + race.RaceDate.ToShortDateString() + ", " + title; List <PitStopData> PitStopData = (from pd in race.PitStopDatas orderby pd.AverageTime ascending select pd).ToList(); this.bsPitStopData.DataSource = PitStopData; }
public frmLoopData(Race race) { InitializeComponent(); string title; if (race.RaceName != null) { title = race.RaceName + " (" + race.Track.Name + ")"; } else { title = race.Track.Name; } this.lblRace.Text = "LoopData for " + race.RaceDate.ToShortDateString() + ", " + title; List <LoopData> loopData = (from ld in race.LoopDatas orderby ld.Rating descending select ld).ToList(); this.bsLoopData.DataSource = loopData; }