Exemplo n.º 1
0
        public ICoatingScheduleControl SwapControlWithTop(ICoatingScheduleControl newControl)
        {
            ICoatingScheduleControl returnControl = null;

            if (LineControls.Count == 0)
            {
                return(null);
            }

            if (newControl.GetType() == LineControls.Last().GetType())
            {
                returnControl   = LineControls.First();
                LineControls[0] = (LineControl)newControl;
            }
            else
            {
                returnControl = LineControls.First().SwapControlWithTop(newControl);
            }
            return(returnControl);
        }
        public ICoatingScheduleControl SwapControlWithBottom(ICoatingScheduleControl newControl)
        {
            ICoatingScheduleControl returnControl = null;

            if (ShiftControls.Count == 0)
            {
                return(null);
            }

            if (newControl.GetType() == ShiftControls.Last().GetType())
            {
                returnControl = ShiftControls.Last();
                ShiftControls[ShiftControls.Count - 1] = (ShiftControl)newControl;
            }
            else
            {
                returnControl = ShiftControls.Last().SwapControlWithBottom(newControl);
            }
            return(returnControl);
        }