Ejemplo n.º 1
0
        public override void SwapChildUp(ICoatingScheduleLogic upChild, ICoatingScheduleLogic lastLogic)
        {
            ICoatingScheduleLogic childProduct = upChild;
            Int32 currentIndex = ChildrenLogic.IndexOf(childProduct);

            if (currentIndex == 0)
            {
                ChildrenLogic.Remove(childProduct);
                Control.RemoveControl(childProduct.Control);
                ParentLogic.SwapChildUp(upChild, this);
            }
            else
            {
                ICoatingScheduleLogic swapProduct = ChildrenLogic[currentIndex - 1];
                ChildrenLogic[currentIndex - 1] = childProduct;
                ChildrenLogic[currentIndex]     = swapProduct;

                childProduct.SwapControls(swapProduct);
            }
        }
Ejemplo n.º 2
0
        public override void SwapChildDown(ICoatingScheduleLogic downChild, ICoatingScheduleLogic lastParent)
        {
            ICoatingScheduleLogic childProduct = downChild;
            Int32 currentIndex = ChildrenLogic.IndexOf(childProduct);

            if (currentIndex == ChildrenLogic.Count - 1) // is at bottom
            {
                ChildrenLogic.Remove(childProduct);
                Control.RemoveControl(childProduct.Control);
                ParentLogic.SwapChildDown(downChild, this);
            }
            else
            {
                ICoatingScheduleLogic swapProduct = ChildrenLogic[currentIndex + 1];
                ChildrenLogic[currentIndex + 1] = childProduct;
                ChildrenLogic[currentIndex]     = swapProduct;

                childProduct.SwapControls(swapProduct);
            }
        }