public void Execute(IDataContext context, DelegateExecute nextExecute) { using (var form = new SettingsForm()) { var repository = new SettingsRepository(); var presenter = new SettingsController(repository, form); presenter.Initialize(); if (form.ShowDialog() == DialogResult.OK) Settings.Values = presenter.Settings; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var settingsForm = new SettingsForm(); settingsForm.SettingChanged += (sender, args) => Debug.WriteLine(args.Name + ": " + (args.Value ?? "default")); settingsForm.SetSetting("browser", true); settingsForm.SetSetting("indent", 4); settingsForm.SetSetting("R#_priority", true); Application.Run(settingsForm); }