Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (AddAssembly assembly = new AddAssembly())
     {
         if (assembly.ShowDialog(this) != DialogResult.Cancel)
         {
             if (assembly.Browse)
             {
                 this.Browse();
                 this.btnOK.Focus();
             }
             else
             {
                 this.lvRefs.SelectedItems.Clear();
                 foreach (AssemblyName name in assembly.GetChosenAssemblies())
                 {
                     this._refChanges = true;
                     foreach (ListViewItem item in this.GetItemsWithSameIdentity(name).ToArray <ListViewItem>())
                     {
                         this.lvRefs.Items.Remove(item);
                     }
                     this.AddListViewAssembly(name).Selected = true;
                 }
                 this.SortAssemblies();
                 this.EnableControls();
                 this.btnOK.Focus();
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (AddAssembly assembly = new AddAssembly())
     {
         if (assembly.ShowDialog(this) != DialogResult.Cancel)
         {
             if (assembly.Browse)
             {
                 this.Browse();
                 this.btnOK.Focus();
             }
             else
             {
                 this.lvRefs.SelectedItems.Clear();
                 foreach (AssemblyName name in assembly.GetChosenAssemblies())
                 {
                     this._refChanges = true;
                     foreach (ListViewItem item in this.GetItemsWithSameIdentity(name).ToArray<ListViewItem>())
                     {
                         this.lvRefs.Items.Remove(item);
                     }
                     this.AddListViewAssembly(name).Selected = true;
                 }
                 this.SortAssemblies();
                 this.EnableControls();
                 this.btnOK.Focus();
             }
         }
     }
 }