Exemplo n.º 1
0
 private void AddLocation(ResourceLocation rl)
 {
     if (lvwLocations.SelectedItems.Count > 0)
     {
         ListViewItem item = lvwLocations.SelectedItems[0];
         item.SubItems[0].Text = rl.URL;
         item.SubItems[1].Text = BoolFormatter.ToString(rl.Authenticate);
         item.SubItems[2].Text = rl.Login;
         item.SubItems[3].Text = rl.Password;
     }
     else
     {
         ListViewItem item = new ListViewItem();
         item.Text = rl.URL;
         item.SubItems.Add(BoolFormatter.ToString(rl.Authenticate));
         item.SubItems.Add(rl.Login);
         item.SubItems.Add(rl.Password);
         lvwLocations.Items.Add(item);
     }
 }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ResourceLocation rl = locationAlternate.ResourceLocation;

            if (lvwLocations.SelectedItems.Count > 0)
            {
                ListViewItem item = lvwLocations.SelectedItems[0];
                item.SubItems[0].Text = rl.URL;
                item.SubItems[1].Text = BoolFormatter.ToString(rl.Authenticate);
                item.SubItems[2].Text = rl.Login;
                item.SubItems[3].Text = rl.Password;
            }
            else
            {
                ListViewItem item = new ListViewItem();
                item.Text = rl.URL;
                item.SubItems.Add(BoolFormatter.ToString(rl.Authenticate));
                item.SubItems.Add(rl.Login);
                item.SubItems.Add(rl.Password);
                lvwLocations.Items.Add(item);
            }
        }