コード例 #1
0
ファイル: HorseSpot.cs プロジェクト: yorgov/HorseTrack
 private void UpdateChannelCollapse(ChannellTimer sender)
 {
     _channels.ForEach(c =>
     {
         if (!c.Equals(sender))
         {
             c.CollapseControl();
         }
     });
 }
コード例 #2
0
ファイル: HorseSpot.cs プロジェクト: yorgov/HorseTrack
        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]);
        }