private void InitWizards() { iWizardUserControlList = new SortedList(); List <object> objectList = ReflectionManager.CreateInstancesByInterface(WizardType); foreach (object obj in objectList) { IWizardUserControl iWizardUserControl = obj as IWizardUserControl; iWizardUserControl.Report = report; iWizardUserControlList.Add(iWizardUserControl.SortID, iWizardUserControl); } SuspendLayout(); foreach (DictionaryEntry de in iWizardUserControlList) { Control control = de.Value as Control; control.Dock = DockStyle.Fill; pnlCenter.Controls.Add(control); } ResumeLayout(); }
private void ShowWizard() { if (iWizardUserControlList.Count == 0) { return; } SuspendLayout(); foreach (DictionaryEntry de in iWizardUserControlList) { (de.Value as Control).Visible = false; } Control control = iWizardUserControlList[currentWizardSortID] as Control; control.Visible = true; IWizardUserControl iWizardUserControl = iWizardUserControlList[currentWizardSortID] as IWizardUserControl; iWizardUserControl.Report = report; lbWizardTitle.Text = iWizardUserControl.Title; lbWizardSummary.Text = iWizardUserControl.Summary; imgWizard.Image = iWizardUserControl.Image; ResumeLayout(); }