private void pinWindow() { try { var item = grdWindows.SelectedItem as PinWindow; if (item == null) { return; } var pe = new PinnedWindowChangedEventArgs(item.ClassWnd, chkUseWildcards.IsChecked != null && chkUseWildcards.IsChecked.Value ? txtWildcards.Text.Trim() : item.TextWnd); if (PinnedWindowChanged != null) { PinnedWindowChanged(this, pe); DialogResult = true; } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void pinWindow() { try { var item = grdWindows.SelectedItem as PinWindow; if (item == null) return; var pe = new PinnedWindowChangedEventArgs(item.ClassWnd, chkUseWildcards.IsChecked != null && chkUseWildcards.IsChecked.Value ? txtWildcards.Text.Trim() : item.TextWnd); if (PinnedWindowChanged != null) { PinnedWindowChanged(this, pe); DialogResult = true; } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void dlgPin_PinnedWindowChanged(object sender, PinnedWindowChangedEventArgs e) { try { var d = sender as WndPin; if (d != null) { d.PinnedWindowChanged -= dlgPin_PinnedWindowChanged; } var note = getSelectedNote(); if (note != null) { note.PinText = e.PinText; note.PinClass = e.PinClass; note.Pinned = true; PNNotesOperations.SaveNotePin(note); if (note.Dialog != null) { note.Dialog.PFooter.SetMarkButtonVisibility(MarkType.Pin, true); } } } catch (Exception ex) { PNStatic.LogException(ex); } }