示例#1
0
 private void editMailContact()
 {
     try
     {
         var item = getSelectedMailContact();
         if (item == null) return;
         var dlgMailContact = new WndMailContact(item) { Owner = this };
         dlgMailContact.MailContactChanged += dlgMailContact_MailContactChanged;
         var showDialog = dlgMailContact.ShowDialog();
         if (showDialog == null || !showDialog.Value)
             dlgMailContact.MailContactChanged -= dlgMailContact_MailContactChanged;
         cmdClearMailContacts.IsEnabled = grdMailContacts.Items.Count > 0;
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
示例#2
0
 private void cmdAddMailContact_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var dlgMailContact = new WndMailContact(null) { Owner = this };
         dlgMailContact.MailContactChanged += dlgMailContact_MailContactChanged;
         var showDialog = dlgMailContact.ShowDialog();
         if (showDialog == null || !showDialog.Value)
             dlgMailContact.MailContactChanged -= dlgMailContact_MailContactChanged;
         cmdClearMailContacts.IsEnabled = grdMailContacts.Items.Count > 0;
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }