private void SaveNote(object sender, RoutedEventArgs e) { string text = Content.Text; MainPageData.Save(text); Debug.WriteLine("Saved Note"); }
private void btnSave_Click(object sender, RoutedEventArgs e) { //MainPageData.Save(txtNoteBody.Text); string value; rebNoteBody.Document.GetText(Windows.UI.Text.TextGetOptions.AdjustCrlf, out value); MainPageData.Save(value); }
private void Search_TextChanged(object sender, TextChangedEventArgs e) { string text = Search.Text; if (text != "") { MainPageData.PerformFiltering(text); } else { MainPageData.ShowAll(); } }
private void txtSearch_TextChanged(object sender, TextChangedEventArgs e) { string tempText; if ((tempText = txtSearch.Text) != "")//if the filter isnt empty... { MainPageData.PerformNoteFiltering(tempText); } else //if it is empty { MainPageData.ShowAll(); } }
private async void btnDelete_Click(object sender, RoutedEventArgs e) { //checks for notes, and gets confirmation from the user if ((lsvNoteList.SelectedIndex != -1) && await ConfirmMessageBoxAsync("Delete this Note")) { Debug.WriteLine("Note Deleted"); apbNoteName.Text = DeselectedTitleValue; //txtNoteBody.Text = DeselectedBodyValue; rebNoteBody.Document.SetText(Windows.UI.Text.TextSetOptions.None, DeselectedBodyValue); MainPageData.DeleteNote(); btnDelete.IsEnabled = false; btnEditNote.IsEnabled = false; } else { btnDelete.IsEnabled = true; //handles canceled delete Debug.WriteLine("Note not Deleted"); } }
private async void DeleteNote(object sender, RoutedEventArgs e) { var title = "Delete Note"; var content = "Are you sure you would like to Delete the current note?"; var Delete = new UICommand("Yes"); var Nothing = new UICommand("No"); var dialog = new MessageDialog(content, title); dialog.Options = MessageDialogOptions.None; dialog.Commands.Add(Delete); dialog.DefaultCommandIndex = 0; dialog.CancelCommandIndex = 0; if (Nothing != null) { dialog.Commands.Add(Nothing); dialog.CancelCommandIndex = (uint)dialog.Commands.Count - 1; } var command = await dialog.ShowAsync(); if (command == Delete) { MainPageData.DeleteNote(); } else if (command == Nothing) { // handle no command } else { // handle cancel command } Debug.WriteLine("Delete Note"); }
private static void SelectNewNote(string title) { MainPageData.AddNewNote(title, ""); }
private static bool CheckForNote(String noteName) { return(MainPageData.CheckForNote(noteName)); }
private static void GetNewNote(string newNoteName) { MainPageData.NewNote(newNoteName, ""); }
public CheckCommand(MainPageData mpd) { this.mpd = mpd; }