private void Connect(Graphics graphics, HorseCtrl hctrl, RaceInfoCtrl rictrl) { var p1 = new Point(hctrl.Left + hctrl.Width, hctrl.Top + hctrl.Height / 2); var p2 = new Point(rictrl.Left, rictrl.Top + rictrl.Height / 2); graphics.DrawLine(_pen, p1, p2); }
void CreateRaceInfos() { _raceInfoCtrls.ForEach(ctrl=>Controls.Remove(ctrl)); _raceInfoCtrls.Clear(); int x = 520, y = 110; List<RaceInfo> raceInfoList = null; if(_rbGoldenFigure.Checked) { raceInfoList = _keyRaces.Races.OrderBy(ri => (-1) * ri.GoldenFigure).ToList(); } else if (_rbGoldenPaceFigure.Checked) { raceInfoList = _keyRaces.Races.OrderBy(ri => (-1) * ri.GoldenPaceFigure).ToList(); } else { raceInfoList = _keyRaces.Races.OrderBy(ri => ri.DaysSince).ToList(); } foreach (var raceinfo in raceInfoList) { if(raceinfo.Matches >=2) { var ctrl = new RaceInfoCtrl(raceinfo); this.Controls.Add(ctrl); ctrl.Location = new Point(x, y); y += ctrl.Height + 20; _raceInfoCtrls.Add(ctrl); } } }