internal NoteDeletedEventArgs(NoteDeleteType type) { _Type = type; }
internal static bool DeleteNote(NoteDeleteType type, PNote note) { try { var result = false; if (note.DockStatus != DockStatus.None) { PreUndockNote(note); } RemoveDeletedNoteFromLists(note); var id = note.ID; switch (type) { case NoteDeleteType.Bin: note.GroupID = (int)SpecialGroups.RecycleBin; note.DateDeleted = DateTime.Now; if (note.Visible && note.Dialog.InAlarm) { note.Dialog.InAlarm = false; } note.Visible = false; note.Dialog = null; note.Schedule = new PNNoteSchedule(); result = SaveNoteDeletedState(note, true); break; case NoteDeleteType.Complete: var groupID = note.GroupID; result = SaveNoteDeletedState(note, false); DeleteNoteCompletely(note, CompleteDeletionSource.SingleNote); PNStatic.FormMain.RaiseDeletedCompletelyEvent(id, groupID); break; } if (note.Thumbnail && PNStatic.Settings.Behavior.ShowNotesPanel) { PNStatic.FormPanel.RemoveThumbnail(note); } DeleteNoteShortcut(id); return result; } catch (Exception ex) { PNStatic.LogException(ex); return false; } }
private void deleteNote(PNote note, NoteDeleteType type) { try { WndNote dlg = null; if (note.Visible) { dlg = note.Dialog; } if (!PNNotesOperations.DeleteNote(type, note)) return; if (dlg != null) { dlg.Close(); } } catch (Exception ex) { PNStatic.LogException(ex); } }