private void note_NoteGroupChanged(object sender, NoteGroupChangedEventArgs e) { if (NoteGroupChanged != null) { NoteGroupChanged(sender, e); } }
private void dlgNewInGroup_NoteGroupChanged(object sender, NoteGroupChangedEventArgs e) { var dlgNewInGroup = sender as WndNewInGroup; if (dlgNewInGroup != null) dlgNewInGroup.NoteGroupChanged -= dlgNewInGroup_NoteGroupChanged; newNoteInGroup(e.NewGroup); }
private void FormMain_NoteGroupChanged(object sender, NoteGroupChangedEventArgs e) { try { var note = sender as PNote; if (note == null) return; var group = getSelectedGroup(); if (group == null) return; var cpn = _Notes.FirstOrDefault(n => n.Id == note.ID); if (cpn == null) return; var grCurrent = PNStatic.Groups.GetGroupByID(note.GroupID); var grPrev = PNStatic.Groups.GetGroupByID(note.PrevGroupID); cpn.IdGroup = note.GroupID; cpn.IdPrevGroup = note.PrevGroupID; cpn.Group = grCurrent != null ? grCurrent.Name : ""; cpn.PrevGroup = grPrev != null ? grPrev.Name : ""; foreach (var item in tvwGroups.Items.OfType<PNTreeItem>()) { if (changeNodeText(item, e.NewGroup)) break; } foreach (var item in tvwGroups.Items.OfType<PNTreeItem>()) { if (changeNodeText(item, e.OldGroup)) break; } updateStatusBar(); } catch (Exception ex) { PNStatic.LogException(ex); } }