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(); } }
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(); }
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(); }
public void DeleteNote(object NoteObj) { NotesArr.Remove((Note)NoteObj); NotesArr.SaveNotes(); }
private void Exit(object parameter) { NotesArr.SaveNotes(); Application.Current.Shutdown(); }