Пример #1
0
        private void addEntry()
        {
            frmEntry E = new frmEntry();

            if (E.ShowDialog(this) == DialogResult.OK)
            {
                lvEntries.Items.Add(E.bmLabel).SubItems.Add(E.bmAddress);
                AddressBook.Add(new BMA(E.bmLabel, E.bmAddress));
            }
            E.Dispose();
        }
Пример #2
0
 private void lvEntries_DoubleClick(object sender, EventArgs e)
 {
     if (lvEntries.SelectedItems.Count > 0)
     {
         int      i = lvEntries.SelectedItems[0].Index;
         frmEntry E = new frmEntry(AddressBook.Addresses[i].Label, AddressBook.Addresses[i].Address);
         if (E.ShowDialog(this) == DialogResult.OK)
         {
             lvEntries.Items[i].Text = E.bmLabel;
             lvEntries.Items[i].SubItems[lvEntries.Items[i].SubItems.Count - 1].Text = E.bmAddress;
             BMA[] Temp = AddressBook.Addresses;
             Temp[i].Address       = E.bmAddress;
             Temp[i].Label         = E.bmLabel;
             AddressBook.Addresses = Temp;
             Temp = null;
         }
         E.Dispose();
     }
 }