示例#1
0
        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();
        }
示例#2
0
        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();
        }