public T ShowDialog <T>(WindowPrepareOptions options) where T : FrmBase, new() { var newForm = PrepareShowDialog <T>(options); newForm.ShowDialog(); return(newForm); }
public T PrepareShowWindow <T>(WindowPrepareOptions options, out bool createdWindow) where T : FrmBase, new() { T newForm = null; using (new StatusBusy(options.StatusText, options.ShowWaitForm)) { if (options.UseExistingFormIfPresent) { if (options.FormDataIdValueToSearchFor != null) { newForm = FindWindowInstanceByData <T>(options.FormDataIdValueToSearchFor); } else { newForm = FindWindowInstance <T>(options.FormIdValueToSearchFor); } } if (newForm == null) { newForm = new T(); newForm.MdiParent = _mdiContainer; newForm.WindowState = options.NewFormState; if (newForm is IInitializableForm) { ((IInitializableForm)newForm).InitializeForm(options.InitalizationParameters); } if (newForm is ILoadableForm && options.NewFormLoadBusinessData) { ((ILoadableForm)newForm).LoadBusiness(); } if (newForm is IFormPermissions) { ((IFormPermissions)newForm).InitPermissions(); } createdWindow = true; } else { createdWindow = false; newForm.Focus(); if (newForm is IReloadableForm && options.ExistingFormReloadBusinessData) { ((IReloadableForm)newForm).ReloadBusiness(); } } } return(newForm); }
public T ShowWindow <T>(WindowPrepareOptions options) where T : FrmBase, new() { bool createdWindow; var newForm = PrepareShowWindow <T>(options, out createdWindow); if (createdWindow) { newForm.Show(); } return(newForm); }
public T ShowDialog <T>(string statusText, bool showWaitForm, FormWindowState state) where T : FrmBase, new() { var options = new WindowPrepareOptions { StatusText = statusText, ShowWaitForm = showWaitForm, NewFormState = state, NewFormLoadBusinessData = true, }; return(ShowDialog <T>(options)); }
public T PrepareShowWindow <T>(string statusText, bool showWaitForm, bool checkExists, FormWindowState state, object formIdValue) where T : FrmBase, new() { var options = new WindowPrepareOptions { StatusText = statusText, ShowWaitForm = showWaitForm, UseExistingFormIfPresent = checkExists, NewFormState = state, FormIdValueToSearchFor = formIdValue }; return(PrepareShowWindow <T>(options)); }
public T PrepareShowDialog <T>(WindowPrepareOptions options) where T : FrmBase, new() { T newForm; using (new StatusBusy(options.StatusText, options.ShowWaitForm)) { newForm = new T(); newForm.WindowState = options.NewFormState; newForm.ControlBox = false; newForm.Owner = _mdiContainer; if (newForm is IInitializableForm) { ((IInitializableForm)newForm).InitializeForm(options.InitalizationParameters); } if (newForm is ILoadableForm && options.NewFormLoadBusinessData) { ((ILoadableForm)newForm).LoadBusiness(); } } return(newForm); }
public T PrepareShowWindow <T>(WindowPrepareOptions options) where T : FrmBase, new() { bool createdWindow; return(PrepareShowWindow <T>(options, out createdWindow)); }