예제 #1
0
 private void LoadConnections(GroupConfigurationElement group)
 {
     this.lvConnections.BeginUpdate();
     try
     {
         this.lvConnections.Items.Clear();
         foreach (FavoriteAliasConfigurationElement favorite in group.FavoriteAliases)
         {
             ListViewItem item = this.lvConnections.Items.Add(favorite.Name);
             item.Name = favorite.Name;
         }
         if (this.lvConnections.Items.Count > 0)
         {
             this.lvConnections.Items[0].Focused = true;
             this.lvConnections.Items[0].Selected = true;
         }
     }
     finally
     {
         this.lvConnections.EndUpdate();
     }
 }
 public void Add(GroupConfigurationElement item)
 {
     this.BaseAdd(item);
 }
예제 #3
0
 public static void AddGroup(GroupConfigurationElement group)
 {
     GetSection().Groups.Add(group);
     SaveImmediatelyIfRequested();
 }
예제 #4
0
 private void tsbAddGroup_Click(object sender, EventArgs e)
 {
     using (NewGroupForm frmNewGroup = new NewGroupForm())
     {
         if (frmNewGroup.ShowDialog() == DialogResult.OK)
         {
             GroupConfigurationElement serversGroup = new GroupConfigurationElement
                                                          {
                                                              Name = frmNewGroup.txtGroupName.Text,
                                                              FavoriteAliases = new FavoriteAliasConfigurationElementCollection()
                                                          };
             Settings.AddGroup(serversGroup);
             this.LoadGroups();
         }
     }
 }
 public void Add(GroupConfigurationElement item)
 {
     this.BaseAdd(item);
 }