public override void SwapChildUp(ICoatingScheduleLogic upChild, ICoatingScheduleLogic lastParent) { if (lastParent.GetType() == typeof(CoatingScheduleLine)) { Int32 indexOfParent = ChildrenLogic.IndexOf((CoatingScheduleLine)lastParent); if (indexOfParent > 0) // if not at the top { lastParent.RemoveLogic(upChild); ChildrenLogic[indexOfParent - 1].AddControlToBottom(upChild); } else if (indexOfParent == 0) { ParentLogic.SwapChildUp(upChild, this); } else { throw new Exception("Invoking object not a member of current object"); } } else { throw new Exception("Call received by a non-child control."); } }
public override void PushUpChildren(ICoatingScheduleLogic upChild) { if (ChildrenLogic.Count > 0 && !ParentLogic.ChildIsTop(this)) { ChildrenLogic.First().SwapUp(); } }
public override void DestroySelf() { for (Int32 index = 0; index < ChildrenLogic.Count; index++) { ChildrenLogic[index].Disconnect(); } ParentLogic.RemoveLogic(this); ChildrenLogic.Clear(); Disconnect(); }
public override bool ChildIsTop(ICoatingScheduleLogic child) { bool isTop = false; if (ChildrenLogic.Count > 0) { isTop = ChildrenLogic.First() == child; if (isTop) { isTop = ParentLogic.ChildIsTop(this); } } return(isTop); }
public override bool ChildIsTop(ICoatingScheduleLogic child) { bool isTop = false; if (child.GetType() == typeof(CoatingScheduleLine) && ChildrenLogic.Count > 0) { isTop = ChildrenLogic.First() == (CoatingScheduleLine)child; if (isTop) { isTop = ParentLogic.ChildIsTop(this); } } else { throw new Exception("Child is not contained in this class."); } return(isTop); }
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); } }
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); } }
public override void PushChildUp(ICoatingScheduleLogic upChild, ICoatingScheduleLogic lastParent) { ParentLogic.PushChildUp(upChild, this); }
public override void PushUp() { ParentLogic.PushChildUp(this, null); }
public override void PushDown() { ParentLogic.PushChildDown(this, null); }
public override void SwapDown() { ParentLogic.SwapChildDown(this, null); }
public override bool ChildIsTop(ICoatingScheduleLogic child) { return(ParentLogic.ChildIsTop(this)); }
public override void PushDown() { ParentLogic.PushDownChildren(this); }
public override void SwapChildDown(ICoatingScheduleLogic downChild, ICoatingScheduleLogic lastParent) { ParentLogic.SwapChildDown(downChild, this); }
public override void SwapChildUp(ICoatingScheduleLogic upChild, ICoatingScheduleLogic lastLogic) { ParentLogic.SwapChildUp(upChild, this); }
public override void SwapUp() { ParentLogic.SwapChildUp(this, this); }
public override void DestroySelf() { ParentLogic.RemoveLogic(this); Disconnect(); }