private void AddServer_Click(object sender, RoutedEventArgs e) { var dialog = new NewServerDialog(async(info) => { await Servers.AddServerAsync(info); }); dialog.Show(); }
private void btnAdd_Click(object sender, EventArgs e) { using (var dialog = new NewServerDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { var setting = new Setting { Name = dialog.ServerName, Path = dialog.Path, Port = dialog.Port }; _settingStorage.Add(setting); AddServer(setting); } } }
private void Item_OnUpdate(WebListItem sender) { using (var dialog = new NewServerDialog(sender.Setting)) { if (dialog.ShowDialog() == DialogResult.OK) { var setting = new Setting { Name = dialog.ServerName, Path = dialog.Path, Port = dialog.Port }; if (_settingStorage.Update(setting)) { sender.UpdateSetting(setting); } } } }