예제 #1
0
 private void note_NoteGroupChanged(object sender, NoteGroupChangedEventArgs e)
 {
     if (NoteGroupChanged != null)
     {
         NoteGroupChanged(sender, e);
     }
 }
예제 #2
0
 private void dlgNewInGroup_NoteGroupChanged(object sender, NoteGroupChangedEventArgs e)
 {
     var dlgNewInGroup = sender as WndNewInGroup;
     if (dlgNewInGroup != null)
         dlgNewInGroup.NoteGroupChanged -= dlgNewInGroup_NoteGroupChanged;
     newNoteInGroup(e.NewGroup);
 }
예제 #3
0
        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);
            }
        }