private void btnAddServer_Click(object sender, RoutedEventArgs e) { var frmAdd = new serverlist.AddServer(ref _sl); if (frmAdd.ShowDialog() == true) { _sl.Write(); btnReflushServer_Click(null, null); } }
private void btnEditServer_Click(object sender, RoutedEventArgs e) { try { int selected = this.listServer.SelectedIndex; var frmEdit = new serverlist.AddServer(ref _sl, selected); if (frmEdit.ShowDialog() == true) { serverlist.serverinfo info = frmEdit.getEdit(); _sl.Edit(selected, info.Name, info.Address, info.IsHide); _sl.Write(); btnReflushServer_Click(null, null); } } catch (ArgumentOutOfRangeException) { MessageBox.Show(LangManager.GetLangFromResource("ServerListNoServerSelect")); } }