Beispiel #1
0
        private async void EmptyRecycleBin()
        {
            MessageBoxResult dialogResult = await _feedbackService.ShowMessageAsync(Language["empty_recyclebin_confirmation"], Language["empty_recyclebin"], MessageBoxButtons.ContinueCancel, false);

            if (dialogResult != MessageBoxResult.Continue)
            {
                return;
            }

            if (RecycledNotes.Count > 0)
            {
                Modified = true;
            }
            RecycledNotes.Clear();

            // Search for all notes placed in the recycling bin
            for (int index = Model.Notes.Count - 1; index >= 0; index--)
            {
                NoteModel note = Model.Notes[index];
                if (note.InRecyclingBin)
                {
                    // Register the note as deleted and remove the note from the list
                    Model.DeletedNotes.Add(note.Id);
                    Model.Notes.Remove(note);
                }
            }

            // Reload empty page (but only if user confirmed command)
            _navigationService.Navigate(new Navigation(ControllerNames.RecycleBin));
        }
Beispiel #2
0
        private void RestoreNote(Guid noteId)
        {
            NoteViewModel viewModel = RecycledNotes.Find(item => noteId == item.Id);

            if (viewModel != null)
            {
                Modified = true;
                viewModel.InRecyclingBin = false;
                RecycledNotes.Remove(viewModel);
            }
            OnPropertyChanged("Notes");
        }
Beispiel #3
0
        private void RestoreNote(object value)
        {
            Guid          noteId    = (value is Guid) ? (Guid)value : new Guid(value.ToString());
            NoteViewModel viewModel = RecycledNotes.Find(item => noteId == item.Id);

            if (viewModel != null)
            {
                Modified = true;
                viewModel.InRecyclingBin = false;
                RecycledNotes.Remove(viewModel);
            }
            OnPropertyChanged("Notes");
        }
Beispiel #4
0
        private void EmptyRecycleBin()
        {
            if (RecycledNotes.Count > 0)
            {
                Modified = true;
            }
            RecycledNotes.Clear();

            // Search for all notes placed in the recycling bin
            for (int index = Model.Notes.Count - 1; index >= 0; index--)
            {
                NoteModel note = Model.Notes[index];
                if (note.InRecyclingBin)
                {
                    // Register the note as deleted and remove the note from the list
                    Model.DeletedNotes.Add(note.Id);
                    Model.Notes.Remove(note);
                }
            }
            OnPropertyChanged("Notes");
        }