Example #1
0
        public bool Display(Window parent)
        {
            Wizard wizard = new Wizard
                                {
                                    Owner = parent,
                                    ShowNavigationTree = false,
                                    Title = "Sentinel - Add new logger",
                                    SavedData = Settings
                                };

            wizard.AddPage(new AddNewLoggerWelcomePage());
            wizard.AddPage(new SetLoggerNamePage());
            wizard.AddPage(new ProvidersPage());
            wizard.AddPage(new ViewSelectionPage());
            // wizard.AddPage(new NewLoggerSummaryPage());

            bool? dialogResult = wizard.ShowDialog();
            if (dialogResult == true)
            {
                Settings = wizard.SavedData as NewLoggerSettings;
                Debug.Assert(Settings != null, "Settings should be non-null and of NewLoggerSettings type");
            }

            return dialogResult ?? false;
        }
        public bool Display(Window parent)
        {
            IProviderSettings settings = new ProviderSettings();

            // Construct the wizard
            Wizard wizard = new Wizard
                                {
                                    Owner = parent,
                                    ShowNavigationTree = false,
                                    SavedData = settings,
                                    Title = "Add New Log Provider"
                                };

            wizard.AddPage(new SelectProviderPage());

            var dialogResult = wizard.ShowDialog();
            if (dialogResult == true)
            {
                if (wizard.SavedData == null && !(wizard.SavedData is IProviderSettings))
                {
                    throw new NotImplementedException(
                        "The UserData was either null or the supplied object was not of the expected type: IProviderSettings");
                }

                Settings = (IProviderSettings)wizard.SavedData;
                Provider = Settings.Info;
            }

            return dialogResult ?? false;
        }