private void AddAliasButton_Click(object sender, System.EventArgs e)
        {
            ServerAlias alias = EditAliasForm.ExecuteAdd();

            _configuration.Aliases.Add(alias);
            AddItem(alias);
            SelectAlias(alias.Name);
        }
Beispiel #2
0
 public static ServerAlias ExecuteEdit(ServerAlias alias)
 {
     using (EditAliasForm form = new EditAliasForm())
     {
         form.SetFromAlias(alias);
         if (form.ShowDialog() != DialogResult.OK)
         {
             throw new AbortException();
         }
         return(form.CreateAlias());
     }
 }
        private void EditAliasButton_Click(object sender, System.EventArgs e)
        {
            ServerAlias oldAlias = SelectedAlias;

            if (oldAlias != null)
            {
                ServerAlias newAlias = EditAliasForm.ExecuteEdit(oldAlias);
                RemoveItem(oldAlias);
                _configuration.Aliases.Remove(oldAlias.Name);
                _configuration.Aliases.Add(newAlias);
                AddItem(newAlias);
                SelectAlias(newAlias.Name);
            }
        }