コード例 #1
0
 private void createBook_Click(object sender, System.EventArgs e)
 {
     AddBook addBook = new AddBook();
        DialogResult result = addBook.ShowDialog();
        if (result == DialogResult.OK)
        {
     try
     {
      Novell.AddressBook.AddressBook addrBook = manager.CreateAddressBook(addBook.Name);
      ListViewItem item = new ListViewItem(addrBook.Name, 0);
      item.Tag = addrBook;
      item.Selected = true;
      this.books.Items.Add(item);
     }
     catch (SimiasException ex)
     {
      ex.LogError();
      MessageBox.Show("An error occurred while creating the address book.  Please see the log file for additional information.", "Create Address Book Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     catch (Exception ex)
     {
      logger.Debug(ex, "Creating address book");
      MessageBox.Show("An error occurred while creating the address book.  Please see the log file for additional information.", "Create Address Book Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
        }
 }
コード例 #2
0
 private void newBook_Click(object sender, System.EventArgs e)
 {
     AddBook addBook = new AddBook();
        DialogResult result = addBook.ShowDialog();
        if (result == DialogResult.OK)
        {
     Novell.AddressBook.AddressBook addrBook = manager.CreateAddressBook(addBook.Name);
     ListViewItem item = new ListViewItem(addrBook.Name);
     item.Tag = addrBook;
        }
 }