예제 #1
0
 private void AddFavoritesToGroup(IGroup group)
 {
     using (var frmAddConnection = new AddConnectionForm(this.persistence, this.favoriteIcons))
     {
         if (frmAddConnection.ShowDialog() == DialogResult.OK)
         {
             group.AddFavorites(frmAddConnection.SelectedFavorites);
             this.LoadSelectedGroupFavorites();
             this.persistence.SaveAndFinishDelayedUpdate();
         }
     }
 }
 private void AddFavoritesToGroup(IGroup group)
 {
     using (var frmAddConnection = new AddConnectionForm(this.persistence))
     {
         if (frmAddConnection.ShowDialog() == DialogResult.OK)
         {
             group.AddFavorites(frmAddConnection.SelectedFavorites);
             this.LoadSelectedGroupFavorites();
             this.persistence.SaveAndFinishDelayedUpdate();
         }
     }
 }
        private void tsbAddConnection_Click(object sender, EventArgs e)
        {
            GroupConfigurationElement group = GetSelectedGroup();

            if (group != null)
            {
                AddConnectionForm frmAddConnection = new AddConnectionForm();
                if (frmAddConnection.ShowDialog() == DialogResult.OK)
                {
                    foreach (string connection in frmAddConnection.Connections)
                    {
                        group.FavoriteAliases.Add(new FavoriteAliasConfigurationElement(connection));
                        lvConnections.Items.Add(connection);
                    }
                    Settings.DeleteGroup(group.Name);
                    Settings.AddGroup(group);
                }
            }
        }
 private void tsbAddConnection_Click(object sender, EventArgs e)
 {
     GroupConfigurationElement group = GetSelectedGroup();
     if (group != null)
     {
         AddConnectionForm frmAddConnection = new AddConnectionForm();
         if (frmAddConnection.ShowDialog() == DialogResult.OK)
         {
             foreach (string connection in frmAddConnection.Connections)
             {
                 group.FavoriteAliases.Add(new FavoriteAliasConfigurationElement(connection));
                 lvConnections.Items.Add(connection);
             }
             Settings.DeleteGroup(group.Name);
             Settings.AddGroup(group);
         }
     }
 }