public void AddControlToBottom(ICoatingScheduleLogic logic) { ProductControlBase newControl = ProductControlBase.CreateControl(logic); ProductControls.Add(newControl); logic.Connect(newControl); newControl.Connect(this); }
public void AddControlToTop(ICoatingScheduleLogic logic) { ProductControlBase newControl = ProductControlBase.CreateControl(logic); if (newControl != null) { ProductControls.Insert(0, newControl); logic.Connect(newControl); newControl.Connect(this); } }
public static ProductControlBase CreateControl(ICoatingScheduleLogic logic) { ProductControlBase newControl = null; if (logic.GetType() == typeof(CoatingScheduleProduct)) { newControl = ProductControl.CreateControl(logic); } else if (logic.GetType() == typeof(CoatingScheduleNote)) { newControl = ProductNoteControl.CreateControl(logic); } else { throw new Exception("Cannot create class from passed logic."); } return(newControl); }
public void RemoveControl(ICoatingScheduleControl child) { ProductControlBase removeControl = (ProductControlBase)child; ProductControls.Remove(removeControl); }