コード例 #1
0
 internal NoteDeletedEventArgs(NoteDeleteType type)
 {
     _Type = type;
 }
コード例 #2
0
ファイル: PNEvents.cs プロジェクト: hyrmedia/PNotes.NET
 internal NoteDeletedEventArgs(NoteDeleteType type)
 {
     _Type = type;
 }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
ファイル: WndCP.xaml.cs プロジェクト: hyrmedia/PNotes.NET
 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);
     }
 }