public void Add(IFormInterface form) { FormStack newStack = new FormStack(); newStack.Push(form); AddStackToTop(newStack); if (Added != null) { Added(form, true); } }
static void Main() { new Midas.Nucleo.Negocio.Carga().Iniciar(); new VeiculoZ.Negocio.CargaVeiculoz().Iniciar(); formStack.Push(typeof(Forms.Inicio)); try { formStack.Run(); } catch (Exception e) { MessageBox.Show(e.Message); } }
public void Next(Form currentForm = null, Form nextForm = null) { if (currentForm == null) { FormStack.Push(this.MainForm); } else { FormStack.Push((Form)nextForm); currentForm.Hide(); if (nextForm.Name.Equals("frmImportFile")) { nextForm.Show(); var newForm = (frmImportFile)nextForm; newForm.realPropertyTaxProjectionManager = this.MainForm.realPropertyTaxProjectionManager; //newForm.realPropertyTaxProjectionManager.FormSwitch.M //newForm.realPropertyTaxProjectionManager.FormSwitch = this.MainForm.realPropertyTaxProjectionManager.FormSwitch; } } }
/// <summary> Adds the form as modal (top of the stack) over some existing form. </summary> /// <param name="parentForm"> A form that is at the top of some stack in the list. </param> public void AddModal(IFormInterface form, IFormInterface parentForm) { FormStack searchStack = _first; IFormInterface topmost; while (searchStack != null) { topmost = searchStack.GetTopmostForm(); if (parentForm == topmost) { topmost.Disable(form); searchStack.Push(form); if (Added != null) { Added(form, false); } return; } searchStack = searchStack._next; } throw new ClientException(ClientException.Codes.InvalidParentForm, parentForm.Text); }