void MenuItem_Host_Add(object sender, RoutedEventArgs e) { WndAddServer addServer = new WndAddServer(); addServer.ShowDialog(); if (addServer.isValid) { Hosts.Profile[ActiveServers.Name].Add(addServer.Host); } lbxHosts.Items.Refresh(); addServer.Reset(); addServer.Close(); }
void MenuItem_Host_Edit(object sender, RoutedEventArgs e) { WndAddServer editHost = new WndAddServer(); BO.Host host = (BO.Host)lbxHosts.SelectedItem; editHost.Host = host; editHost.ShowDialog(); if (editHost.isValid) { Hosts.Profile[ActiveServers.Name][Hosts.Profile[ActiveServers.Name].IndexOf((BO.Host)lbxHosts.SelectedItem)] = editHost.Host; } lbxHosts.Items.Refresh(); editHost.Reset(); editHost.Close(); }