Exemplo n.º 1
0
        private void tItem_MoveUpRequest(OrderListItem tItem)
        {
            if (null == tItem)
            {
                return;
            }
            Int32 tIndex = m_SortedList.Values.IndexOf(tItem);

            if (0 == tIndex)
            {
                //! already the top most
                return;
            }

            Int32         tKey       = m_SortedList.Keys[tIndex];
            Int32         tTempKey   = m_SortedList.Keys[tIndex - 1];
            OrderListItem tTempItemA = m_SortedList.Values[tIndex - 1];

            m_SortedList.Remove(tTempKey);          //!< remove lower item
            m_SortedList.Remove(tKey);              //!< remove target

            m_SortedList.Add(tKey, tTempItemA);
            m_SortedList.Add(tTempKey, tItem);

            RefreshOrderList();
        }
Exemplo n.º 2
0
        private void tItem_MoveDownRequest(OrderListItem tItem)
        {
            if (null == tItem)
            {
                return;
            }
            Int32 tIndex = m_SortedList.Values.IndexOf(tItem);

            if (tIndex == (m_SortedList.Keys.Count - 1))
            {
                //! already at the bottom
                return;
            }

            Int32         tKey       = m_SortedList.Keys[tIndex];
            Int32         tTempKey   = m_SortedList.Keys[tIndex + 1];
            OrderListItem tTempItemA = m_SortedList.Values[tIndex + 1];

            m_SortedList.Remove(tTempKey);          //!< remove lower item
            m_SortedList.Remove(tKey);              //!< remove target

            m_SortedList.Add(tKey, tTempItemA);
            m_SortedList.Add(tTempKey, tItem);

            RefreshOrderList();
        }
Exemplo n.º 3
0
        private void tItem_RemoveRequest(OrderListItem tItem)
        {
            if (null == tItem)
            {
                return;
            }
            Int32 tIndex = m_SortedList.Values.IndexOf(tItem);

            m_SortedList.Remove(m_SortedList.Keys[tIndex]);     //!< remove target

            tItem.RemoveRequest       -= new OrderChangeReport(tItem_RemoveRequest);
            tItem.SendToBottomRequest -= new OrderChangeReport(tItem_SendToBottomRequest);
            tItem.MoveUpRequest       -= new OrderChangeReport(tItem_MoveUpRequest);
            tItem.MoveDownRequest     -= new OrderChangeReport(tItem_MoveDownRequest);
            tItem.BringToTopRequest   -= new OrderChangeReport(tItem_BringToTopRequest);

            RefreshOrderList();
        }
Exemplo n.º 4
0
        private void tItem_BringToTopRequest(OrderListItem tItem)
        {
            if (null == tItem)
            {
                return;
            }
            Int32 tIndex = m_SortedList.Values.IndexOf(tItem);

            if (0 == tIndex)
            {
                //! already the top most
                return;
            }
            Int32 tTempKey = m_SortedList.Keys[0] - 1;

            m_SortedList.Remove(m_SortedList.Keys[tIndex]);     //!< remove target
            m_SortedList.Add(tTempKey, tItem);                  //!< add it to the top

            RefreshOrderList();
        }
Exemplo n.º 5
0
        public Boolean Add(Control[] tControls, ORDERLIST_ORDER tOrder)
        {
            OrderListItem tItem = new OrderListItem(tControls);


            if (0 == m_SortedList.Count)
            {
                m_SortedList.Add(0, tItem);                     //!< first item
                //flpOrderList.Controls.Add(tItem.TargetPanel);
            }
            else
            {
                Int32 tKey = 0;
                switch (tOrder)
                {
                case ORDERLIST_ORDER.ORDERLIST_TOP:
                    tKey = m_SortedList.Keys[0] - 1;            //!< top item
                    //RefreshOrderList();
                    break;

                case ORDERLIST_ORDER.ORDERLIST_BOTTOM:
                default:
                    //! bottom item
                    tKey = m_SortedList.Keys[m_SortedList.Keys.Count - 1] + 1;
                    //flpOrderList.Controls.Add(tItem.TargetPanel);
                    break;
                }
                m_SortedList.Add(tKey, tItem);
            }

            tItem.RemoveRequest       += new OrderChangeReport(tItem_RemoveRequest);
            tItem.SendToBottomRequest += new OrderChangeReport(tItem_SendToBottomRequest);
            tItem.MoveUpRequest       += new OrderChangeReport(tItem_MoveUpRequest);
            tItem.MoveDownRequest     += new OrderChangeReport(tItem_MoveDownRequest);
            tItem.BringToTopRequest   += new OrderChangeReport(tItem_BringToTopRequest);

            RefreshOrderList();

            return(true);
        }
Exemplo n.º 6
0
        private void tItem_SendToBottomRequest(OrderListItem tItem)
        {
            if (null == tItem)
            {
                return;
            }
            Int32 tIndex = m_SortedList.Values.IndexOf(tItem);

            if (tIndex == (m_SortedList.Keys.Count - 1))
            {
                //! already at the bottom
                return;
            }
            Int32 tTempKey = m_SortedList.Keys[(m_SortedList.Keys.Count - 1)] + 1;

            m_SortedList.Remove(m_SortedList.Keys[tIndex]);     //!< remove target
            m_SortedList.Add(tTempKey, tItem);                  //!< add it to the top

            //flpOrderList.Controls.Remove(tItem.TargetPanel);
            //flpOrderList.Controls.Add(tItem.TargetPanel);

            RefreshOrderList();
        }
Exemplo n.º 7
0
 public OrderListItemPanel(OrderListItem tParent)
 {
     m_Tag             = tParent;
     this.ResizeRedraw = true;
     Initialize();
 }