private void cmdAddContactGroup_Click(object sender, RoutedEventArgs e) { try { var newID = 0; if (_Groups.Count > 0) { newID = _Groups.Max(g => g.ID) + 1; } var dlgContactGroup = new WndGroups(newID) { Owner = this }; dlgContactGroup.ContactGroupChanged += dlgContactGroup_ContactGroupChanged; var showDialog = dlgContactGroup.ShowDialog(); if (showDialog != null && !showDialog.Value) { dlgContactGroup.ContactGroupChanged -= dlgContactGroup_ContactGroupChanged; } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void editContactsGroup() { try { var gr = getSelectedContactsGroup(); if (gr == null) return; var dlgContactGroup = new WndGroups(gr) { Owner = this }; dlgContactGroup.ContactGroupChanged += dlgContactGroup_ContactGroupChanged; var showDialog = dlgContactGroup.ShowDialog(); if (showDialog != null && !showDialog.Value) { dlgContactGroup.ContactGroupChanged -= dlgContactGroup_ContactGroupChanged; } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void actionAddContactsGroup() { try { var newId = 0; if (PNStatic.ContactGroups.Count > 0) { newId = PNStatic.ContactGroups.Max(g => g.ID) + 1; } var dlgContactGroup = new WndGroups(newId) { Owner = this }; dlgContactGroup.ContactGroupChanged += dlgContactGroup_ContactGroupChanged; var showDialog = dlgContactGroup.ShowDialog(); if (showDialog == null || !showDialog.Value) { dlgContactGroup.ContactGroupChanged -= dlgContactGroup_ContactGroupChanged; } } catch (Exception ex) { PNStatic.LogException(ex); } }