public bool RemoveItem(MapItemBase item) { var row = GetRow(item); if (row < 0) { return(false); } Controls.Remove(item); return(true); }
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); }
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); } }