예제 #1
0
 //cargar form
 private void frmGame_Load(object sender, EventArgs e)
 {
     //agregar "controlador" para userControl
     currentControl      = new ControlMenu();
     currentControl.Dock = DockStyle.Fill;
     Controls.Add(currentControl);
     currentControl.Width  = Width;
     currentControl.Height = Height;
 }
예제 #2
0
 public SourceTabView(Model model, TabControl tab, NewControl nc)
 {
     this.model = model;
     this.tab   = tab;
     this.nc    = nc;
     model.ObjectChangedHandler += new ObjectChangedEventHandler(this.ObjectChanged);
     foreach (object o in model.Roots)
     {
         this.AddRoot(o);
     }
     this.ObjectChanged();
 }
예제 #3
0
 //Método para cambio de userControl
 public void ChangeControl(NewControl newControl)
 {
     if (newControl == null)
     {
         throw new ArgumentNullException("newControl");
     }
     //remover userControl actual
     if (currentControl != null)
     {
         this.Controls.Remove(currentControl);
     }
     //Crear nuevo userControl y definir dimensiones
     currentControl        = newControl;
     currentControl.Width  = Width;
     currentControl.Height = Height;
     //agregar userControl
     this.Controls.Add(newControl);
 }
예제 #4
0
 //Método definir userControl a cambiar
 public void ShowControl(NewControl control)
 {
     //cambiando currentUserControl
     this.ChangeControl(control);
 }
예제 #5
0
 private void OnNewControl(Control control)
 {
     NewControl?.Invoke(control);
 }