Beispiel #1
0
        public void AddControlToBottom(ICoatingScheduleLogic logic)
        {
            ProductControlBase newControl = ProductControlBase.CreateControl(logic);

            ProductControls.Add(newControl);
            logic.Connect(newControl);
            newControl.Connect(this);
        }
Beispiel #2
0
        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);
        }
Beispiel #4
0
        public void RemoveControl(ICoatingScheduleControl child)
        {
            ProductControlBase removeControl = (ProductControlBase)child;

            ProductControls.Remove(removeControl);
        }