Example #1
0
 public IControl AddControl(IControl control)
 {
     if (HasControl(control))
         throw new InvalidOperationException("Cannot add a control more than once.");
     control.Enable();
     _controls.Add(control);
     control.Show();
     return control;
 }
Example #2
0
 public IControl AddControl(IControl control)
 {
     if (HasControl(control))
     {
         throw new InvalidOperationException("Cannot add a control more than once.");
     }
     control.Enable();
     _controls.Add(control);
     control.Show();
     return(control);
 }