Example #1
0
        private void DeleteAllNotes(object parameter)
        {
            Console.WriteLine("DeleteAllNotes");
            MessageBoxResult result = MessageBox.Show("Delete all notes?", "Are your sure?", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                NotesArr.DeleteAllNotes();
            }
        }
Example #2
0
        public void CreateNote(object parameter)
        {
            Console.WriteLine("CheckAndInvokeCommand");
            if (TextToCreate == null || TextToCreate == "")
            {
                return;
            }
            if (TopicToCreate == null || TopicToCreate == "")
            {
                return;
            }

            NotesArr.CreateNote(TopicToCreate, TextToCreate, IsImportantToCreate, DeadlineToCreate);

            NotesArr.SaveNotes();
        }
Example #3
0
        public void EditNote(object NoteObj)
        {
            Note     oldNote     = (Note)NoteObj;
            bool     isImportant = oldNote.IsImportant;
            DateTime deadline    = new DateTime();

            try
            {
                DeadlinedNote note = (DeadlinedNote)NoteObj;
                deadline = note.Deadline;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            NotesArr.RemoveNote(oldNote);
            NotesArr.CreateNote(TopicToEdit, TextToEdit, isImportant, deadline);
            NotesArr[0].setEdited();
        }
Example #4
0
 public void DeleteNote(object NoteObj)
 {
     NotesArr.Remove((Note)NoteObj);
     NotesArr.SaveNotes();
 }
Example #5
0
 private void Exit(object parameter)
 {
     NotesArr.SaveNotes();
     Application.Current.Shutdown();
 }