public bool Display(Window parent)
        {
            var 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());

            var 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);
        }
Esempio n. 2
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 object Save(object saveData)
        {
            Debug.Assert(saveData is NewLoggerSettings, "Expecting to have a NewLoggerSettings instance");
            Debug.Assert(saveData as NewLoggerSettings != null, "Not expecting a null");

            NewLoggerSettings settings = saveData as NewLoggerSettings;

            if (settings != null)
            {
                settings.LogName = LogName;
            }

            return(saveData);
        }
Esempio n. 4
0
        public object Save(object saveData)
        {
            Debug.Assert(saveData != null, "Expecting an instance to save data into");
            Debug.Assert(saveData is NewLoggerSettings, "Expecting a NewLoggerSettings instance");

            NewLoggerSettings settings = saveData as NewLoggerSettings;

            if (settings != null)
            {
                settings.Providers.Clear();
                foreach (var provider in Providers)
                {
                    settings.Providers.Add(provider);
                }
            }

            return(saveData);
        }
        public object Save(object saveData)
        {
            Debug.Assert(saveData != null, "Expecting a non-null instance of a class to save settings into");
            Debug.Assert(saveData is NewLoggerSettings, "Expecting save data structure to be a NewLoggerSettings");

            NewLoggerSettings settings = saveData as NewLoggerSettings;

            if (settings != null)
            {
                settings.Views.Clear();
                settings.Views.Add(registeredViews.ElementAt(PrimaryIndex).Identifier);
                if (MultipleView)
                {
                    settings.Views.Add(registeredViews.ElementAt(SecondaryIndex).Identifier);
                    settings.IsVertical = Vertical;
                }
            }

            return(saveData);
        }
 public NewLoggerWizard()
 {
     Settings = new NewLoggerSettings();
 }
Esempio n. 7
0
 public NewLoggerWizard()
 {
     Settings = new NewLoggerSettings();
 }