Пример #1
0
        public void Reposition()
        {
            _panel.SuspendLayout();

            int count  = _controlerLists.Count;
            int width  = _panel.ClientSize.Width;
            int height = _panel.ClientSize.Height;

            List <Rectangle> rlist = new List <Rectangle>();
            int xInterval          = width / (2 * count + 1);

            for (int i = 0; i < count; i++)
            {
                IControler ctl  = _controlerLists[i];
                Control    ctrl = ctl.GetControl();
                if (ctrl == null)
                {
                    continue;
                }
                ctrl.Top   = (height - ctrl.Height) / 2;
                ctrl.Left  = xInterval * (i * 2 + 1);
                ctrl.Width = xInterval;
            }

            _panel.ResumeLayout();
        }
Пример #2
0
        public void RemoveList(IControler list)
        {
            if (_controlerLists.Contains(list))
            {
                list.Panel         = null;
                list.ItemSelected -= new ItemSelectedHandler(list_ItemSelected);

                _controlerLists.Remove(list);

                Control ctrl = list.GetControl();
                if (!_panel.Controls.Contains(ctrl))
                {
                    _panel.Controls.Add(ctrl);
                }
            }
        }
Пример #3
0
        public void AddList(IControler list)
        {
            if (list == null)
            {
                return;
            }

            list.Panel         = this;
            list.ItemSelected += new ItemSelectedHandler(list_ItemSelected);

            _controlerLists.Add(list);

            Control ctrl = list.GetControl();

            if (ctrl != null)
            {
                _panel.Controls.Add(ctrl);
                ctrl.Visible = true;
            }
        }