public HorseSpot(HorseSpotInformation info = null) { InitializeComponent(); AddComponentsForRef(); if (info == null) return; SetTimes(info); }
private void addNewSpot(HorseSpotInformation item) { var newSpot = new HorseSpot(item); newSpot.Caption = item.Name; newSpot.BorderStyle = BorderStyle.FixedSingle; newSpot.OnCloseClicked += horseSpot_OnCloseClicked; newSpot.OnStartClicked += horseSpot_OnStartedClicked; flowLayoutPanel1.Controls.Add(newSpot); }
private void SetTimes(HorseSpotInformation Info) { Caption = Info.Name; for (int i = 0; i < _channels.Count; i++) { _channels[i] = new ChannellTimer(Info.Channels.First(c => c.ChannelName == _channels[i].ChannelName), Info.RefTime); _channels[i].OnExpandClicked += channelTimer_OnExpandClicked; _channels[i].OnTimerStarted += ChannelTimerStarted; _channels[i].OnTimerTick += channelTimer_OnTimerTick; } //populating the right flowPanel tableLayoutPanel2.Controls[1].Controls.Clear(); tableLayoutPanel2.Controls[1].Controls.AddRange(_channels.Take(6).ToArray()); //populating the left flowPanel tableLayoutPanel2.Controls[0].Controls.Clear(); tableLayoutPanel2.Controls[0].Controls.AddRange(_channels.Skip(6).Take(6).ToArray()); //collaps all channel timers except the first UpdateChannelCollapse(_channels[0]); }