Esempio n. 1
0
        public void SelectChange(EngineCoachList01 list)
        {
            try
            {
                foreach (var it in panList.Controls)
                {
                    if (it is EngineCoachList01)
                    {
                        EngineCoachList01 l = (EngineCoachList01)it;

                        l.isSelect  = false;
                        l.BackColor = Color.Transparent;
                    }
                }
            }
            catch (Exception ex)
            {
                RTCore.Environment.ReportError(ex, AccessManager.AccessKey);
            }
        }
Esempio n. 2
0
        private void ListDraw(EngineCoach.LocomotiveData.LocomotiveRank?rank)
        {
            try
            {
                tt.RemoveAll();
                panList.Size     = new Size(730, 0);
                panList.Location = new Point(0, 0);

                int y = 0;
                foreach (var it in TrainManager.EngineCoachs)
                {
                    if (rank != null && it.Locomotive.Rank != rank.GetValueOrDefault())
                    {
                        continue;
                    }
                    EngineCoachList01 rl = new EngineCoachList01(it, this);
                    rl.Location = new Point(0, y);
                    panList.Controls.Add(rl);
                    y           += rl.Height;
                    panList.Size = new Size(730, y);
                }

                if (panList.Controls.Count <= 2)
                {
                    panListBack.AutoScroll = false;
                    panListBack.Size       = new Size(730, panListBack.Height);
                }
                else
                {
                    panListBack.AutoScroll = true;
                    panListBack.Size       = new Size(750, panListBack.Height);
                }
            }
            catch (Exception ex)
            {
                RTCore.Environment.ReportError(ex, AccessManager.AccessKey);
            }
        }