Exemplo n.º 1
0
        /// <summary>
        /// We found a note command, so we save it
        /// </summary>
        /// <param name="note"></param>
        private void HandleNoteCommands(string text)
        {
            noting = true;

            note = new Notes();
            note.date = DateTime.Now;
            note.note = text;
            bool verify = StorageHelper.GetSetting("VERIFY_INPUT", true);
            if (verify)
            {
                CortanaOverlay("I heard you say:", note.note, "Should i note it?");
            }
            else
            {
                note.Save();
                NotesList.ItemsSource = note.GetAllNotes();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// We need to check if the app called by Cortana and then handle the voice commands, else whe install the voice commands
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode == NavigationMode.New)
            {
                string voiceCommandName;
                if (NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName))
                {
                    HandleVoiceCommand(voiceCommandName);
                }
                else
                {
                    Task.Run(() => InstallVoiceCommands());
                }
            }

            bool delete = StorageHelper.GetSetting("AUTO_DELETE", false);
            int days = StorageHelper.GetSetting("MAXIMUM_DATE", 1);

            Notes notes = new Notes();
            notes.DestroyOldNotes(days, delete);
            NotesList.ItemsSource = notes.GetAllNotes();
        }