Пример #1
0
 public void Add(PushPanelItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     _owner.AddItem(item);
 }
Пример #2
0
            void IList.Insert(int index, object value)
            {
                PushPanelItem item = value as PushPanelItem;

                if (value != null)
                {
                    ((IList)_owner.Controls).Insert(index, value);
                }
            }
Пример #3
0
            void IList.Remove(object value)
            {
                PushPanelItem item = value as PushPanelItem;

                if (value != null)
                {
                    Remove(item);
                }
            }
Пример #4
0
            bool IList.Contains(object value)
            {
                PushPanelItem item = value as PushPanelItem;

                if (value != null)
                {
                    return(Contains(item));
                }
                return(false);
            }
Пример #5
0
            int IList.IndexOf(object value)
            {
                PushPanelItem item = value as PushPanelItem;

                if (value != null)
                {
                    return(IndexOf(item));
                }
                return(-1);
            }
Пример #6
0
            int IList.Add(object value)
            {
                PushPanelItem item = value as PushPanelItem;

                if (item != null)
                {
                    Add(item);
                    return(IndexOf(item));
                }
                return(-1);
            }
Пример #7
0
        internal void CollapseItem(PushPanelItem item)
        {
            if (item == null || !item.IsExpanded)
            {
                return;
            }

            ChangeItemHeight(item, false);
            ReLayout();
            item.IsExpanded = false;
            _expandItem     = null;
        }
Пример #8
0
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            PushPanelItem item = e.Control as PushPanelItem;

            if (item != null)
            {
                item.Owner              = null;
                item.CaptionMouseClick -= ItemCaptionMouseClick;
            }

            base.OnControlRemoved(e);

            ReLayout();
        }
Пример #9
0
 public void ExpandItem(int index)
 {
     try
     {
         PushPanelItem item = _items[index];
         if (item != null)
         {
             ExpandItem(item);
         }
     }
     catch
     {
     }
 }
Пример #10
0
 public void ExpandItem(string name)
 {
     try
     {
         PushPanelItem item = _items[name];
         if (item != null)
         {
             ExpandItem(item);
         }
     }
     catch
     {
     }
 }
Пример #11
0
        private void AddItem(PushPanelItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            item.Height             = item.CaptionHeight;
            item.Owner              = this;
            item.CaptionMouseClick += ItemCaptionMouseClick;

            base.Controls.Add(item);

            ReLayout();
        }
Пример #12
0
        internal void ChangeItemHeight(PushPanelItem item, bool expand)
        {
            if (item == null)
            {
                return;
            }

            if (expand)
            {
                item.Height = item.CaptionHeight + CalcuExpandItemHeight();
            }
            else
            {
                if (item.IsExpanded)
                {
                    item.Height = item.CaptionHeight;
                }
            }
        }
Пример #13
0
        internal void ExpandItem(PushPanelItem item)
        {
            if (item == null || _expandItem == item)
            {
                return;
            }

            if (_expandItem != null)
            {
                ChangeItemHeight(_expandItem, false);
            }

            ChangeItemHeight(item, true);

            ReLayout();
            if (_expandItem != null)
            {
                _expandItem.IsExpanded = false;
            }
            item.IsExpanded = true;
            _expandItem     = item;
        }
Пример #14
0
 public int IndexOf(PushPanelItem item)
 {
     return _owner.Controls.IndexOf(item);
 }
Пример #15
0
 public bool Contains(PushPanelItem item)
 {
     return _owner.Controls.Contains(item);
 }
Пример #16
0
 public void AddRange(PushPanelItem[] values)
 {
     foreach (PushPanelItem item in values)
     {
         Add(item);
     }
 }
Пример #17
0
 public void Add(PushPanelItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     _owner.AddItem(item);
 }
Пример #18
0
        private void AddItem(PushPanelItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            item.Height = item.CaptionHeight;
            item.Owner = this;
            item.CaptionMouseClick += ItemCaptionMouseClick;

            base.Controls.Add(item);

            ReLayout();
        }
Пример #19
0
        internal void ChangeItemHeight(PushPanelItem item, bool expand)
        {
            if (item == null)
            {
                return;
            }

            if (expand)
            {
                item.Height = item.CaptionHeight + CalcuExpandItemHeight();
            }
            else
            {
                if (item.IsExpanded)
                {
                    item.Height = item.CaptionHeight;
                }
            }
        }
Пример #20
0
 public void Remove(PushPanelItem item)
 {
     _owner.Controls.Remove(item);
 }
Пример #21
0
        internal void ExpandItem(PushPanelItem item)
        {
            if (item == null || _expandItem == item)
            {
                return;
            }

            if (_expandItem != null)
            {
                ChangeItemHeight(_expandItem, false);
            }

            ChangeItemHeight(item, true);

            ReLayout();
            if (_expandItem != null)
            {
                _expandItem.IsExpanded = false;
            }
            item.IsExpanded = true;
            _expandItem = item;
        }
 public PushPanelItemCaptionClickEventArgs(PushPanelItem item)
     : this()
 {
     _item = item;
 }
Пример #23
0
 public bool Contains(PushPanelItem item)
 {
     return(_owner.Controls.Contains(item));
 }
Пример #24
0
 public void Remove(PushPanelItem item)
 {
     _owner.Controls.Remove(item);
 }
Пример #25
0
        internal void CollapseItem(PushPanelItem item)
        {
            if (item == null || !item.IsExpanded)
            {
                return;
            }

            ChangeItemHeight(item, false);
            ReLayout();
            item.IsExpanded = false;
            _expandItem = null;
        }
Пример #26
0
 public PushPanelItemCaptionClickEventArgs(PushPanelItem item)
     : this()
 {
     _item = item;
 }
Пример #27
0
 public int IndexOf(PushPanelItem item)
 {
     return(_owner.Controls.IndexOf(item));
 }