// function constructs and displays a wizard helping to create new configuration public static string createWithWizard() { WizardSheet wizard = new WizardSheet(); WelcomePage welcomePage = new WelcomePage(); MidPage_DesignApproach midpage_DA = new MidPage_DesignApproach(); MidPage_UseNamespaces midpage_UN = new MidPage_UseNamespaces(); MidPage_Redundancy midpage_R = new MidPage_Redundancy(); CompletePage completePage = new CompletePage(); wizard.Pages.Add(welcomePage); wizard.Pages.Add(midpage_DA); wizard.Pages.Add(midpage_UN); wizard.Pages.Add(midpage_R); wizard.Pages.Add(completePage); if (wizard.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Configuration conf = new Configuration(); conf.setDesignApproach(midpage_DA.getDesignApproach()); conf.setUsingNamespaces(midpage_UN.getUseNamespaces()); conf.setEliminateRedundantAPs(midpage_R.isElimRedAPsEnabled()); conf.setEliminateRedundantAttrDecls(midpage_R.isElimRedAttrDeclsEnabled()); conf.setEliminateRedundancyInNestings(midpage_R.isElimRedInNestingsEnabled()); string saveFileName = completePage.getFileName(); if ((saveFileName != null) && (saveFileName != "")) { conf.Save(saveFileName); } return(saveFileName); } return(null); }
static void Main() { WizardSheet wizard = new WizardSheet(); wizard.Pages.Add(new WelcomePage()); MidPage_DesignApproach midpage_DA = new MidPage_DesignApproach(); MidPage_UseNamespaces midpage_UN = new MidPage_UseNamespaces(); MidPage_Redundancy midpage_R = new MidPage_Redundancy(); CompletePage completePage = new CompletePage(); wizard.Pages.Add(midpage_DA); wizard.Pages.Add(midpage_UN); wizard.Pages.Add(midpage_R); wizard.Pages.Add(completePage); Application.EnableVisualStyles(); Application.Run(wizard); }