private void UpdateGrid() { _txtboxTrackName.Text = RaceTracks.GetNameFromTrackCode(_race.Parent.TrackCode); _txtboxRaceNumber.Text = _race.RaceNumber.ToString(); _txtboxDate.Text = _race.Parent.Date; if (null != _race.CorrespondingBrisRace) { _txtboxDistance.Text = _race.CorrespondingBrisRace[0].TodaysDistance; _txtboxRaceConditions.Text = _race.CorrespondingBrisRace[0].RaceConditions; } int y = 20, dy = 860; int x = 24; foreach (HorseFractionsComponent c in _fractionComponents) { this._panelPastPerformances.Controls.Remove(c); } this.SuspendLayout(); _fractionComponents.Clear(); foreach (Horse horse in _race.Horses) { BrisHorse.TimingType timingType = (this._radioShowLeadersTime.Checked ? BrisHorse.TimingType.LeadersHorse : BrisHorse.TimingType.ThisHorse); if (horse.Scratched) { continue; } var fsp = new HorseFractionsComponent(horse, timingType); fsp.Location = new System.Drawing.Point(x, y); fsp.Size = new System.Drawing.Size(1280, dy-10); this._panelPastPerformances.Controls.Add(fsp); _fractionComponents.Add(fsp); y += dy; fsp.BorderStyle = BorderStyle.FixedSingle; } this.ResumeLayout(false); this.Refresh(); this.AdjustFormScrollbars(true); }
public static int CompareByPrimePower(HorseFractionsComponent c1, HorseFractionsComponent c2) { if (c1.PrimePowerRating > c2.PrimePowerRating) { return -1; } else if (c1.PrimePowerRating < c2.PrimePowerRating) { return 1; } else { return 0; } }
public ShowRunTogethersControl(HorseFractionsComponent hfc) { _hfc = hfc; InitializeComponent(); }