private static void GetAllForms(ref List <Form_WizardBase> _list, Form_WizardBase _entryForm) { _list.Add(_entryForm); if (_entryForm.Next != null) { WizardManager.GetAllForms(ref _list, _entryForm.Next); } }
public static T StartWizard <T>(Form_WizardBase _entryForm) { if (_entryForm.Previous != null) { throw new Exception("EntryForm ne sme imet previousa!!!"); } T _t = WizardManager.RunForm <T>(_entryForm); #region "Dispose all" List <Form_WizardBase> _list = new List <Form_WizardBase>(); WizardManager.GetAllForms(ref _list, _entryForm); foreach (Form_WizardBase _form_WizardBase in _list) { if (!_entryForm.Disposing) { _form_WizardBase.Dispose(); } } #endregion "Dispose all" return(_t); }