Exemplo n.º 1
0
        public bool RemoveItem(MapItemBase item)
        {
            var row = GetRow(item);

            if (row < 0)
            {
                return(false);
            }
            Controls.Remove(item);

            return(true);
        }
Exemplo n.º 2
0
        public int RegisterIndex(MapItemBase item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            int index;

            registeredIndex.TryGetValue(item.GetType(), out index);
            index++;
            registeredIndex[item.GetType()] = index;
            return(index);
        }
Exemplo n.º 3
0
        public void MoveItemDown(MapItemBase item)
        {
            var index = GetRow(item);

            if (index >= RowCount - 1 || RowCount < 3)
            {
                return;
            }
            SuspendLayout();
            try
            {
                var other = GetControlFromPosition(0, index + 1);
                SetRow(other, index);
                SetRow(item, index + 1);
                Controls.SetChildIndex(item, index + 1);
                Controls.SetChildIndex(other, index);
            }
            finally
            {
                ResumeLayout(true);
            }
        }