Example #1
0
        private void SaveNote(object sender, RoutedEventArgs e)
        {
            string text = Content.Text;

            MainPageData.Save(text);
            Debug.WriteLine("Saved Note");
        }
Example #2
0
        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);
        }
Example #3
0
        private void Search_TextChanged(object sender, TextChangedEventArgs e)
        {
            string text = Search.Text;

            if (text != "")
            {
                MainPageData.PerformFiltering(text);
            }
            else
            {
                MainPageData.ShowAll();
            }
        }
Example #4
0
        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();
            }
        }
Example #5
0
 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");
     }
 }
Example #6
0
        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");
        }
Example #7
0
 private static void SelectNewNote(string title)
 {
     MainPageData.AddNewNote(title, "");
 }
Example #8
0
 private static bool CheckForNote(String noteName)
 {
     return(MainPageData.CheckForNote(noteName));
 }
Example #9
0
 private static void GetNewNote(string newNoteName)
 {
     MainPageData.NewNote(newNoteName, "");
 }
Example #10
0
 public CheckCommand(MainPageData mpd)
 {
     this.mpd = mpd;
 }