Exemple #1
0
        public void commandProcessing()
        {
            var    stream   = new MemoryStream(File.ReadAllBytes("01.wav"));
            string result   = SpeechRecognizer.WavStreamToGoogle(stream);
            int    remindId = JsonWorker.getNumber(result);

            if (remindId == -1)
            {
                return;
            }
            // Проверяем, число ли в строке, на выходе значение для remindId
            AgreeForm deleteForm = new AgreeForm("Вы действительно хотите удалить напоминание под номером " + remindId.ToString() + "? \n\nНажмите Enter для удаления.\nНажмите пробел для отмены.",
                                                 reminds.getRemindById(remindId), true);

            deleteForm.ShowDialog();
            this.Close();
        }
        public void commandProcessing()
        {
            var      stream              = new MemoryStream(File.ReadAllBytes("01.wav"));
            string   result              = SpeechRecognizer.WavStreamToGoogle(stream);
            string   command             = JsonWorker.Convert(result);
            DateTime dateAndTimeOfRemind = dateAndTime.Value.Date;
            string   timeInStr           = timeList.Text.Substring(0, 2);
            int      timeInInt           = Int32.Parse(timeInStr);
            TimeSpan time = new TimeSpan(timeInInt, 0, 0);

            dateAndTimeOfRemind += time;
            Remind remind = new Remind(remindList.remindList.Count, dateAndTimeOfRemind, command);

            setData(remind);
            AgreeForm saveForm = new AgreeForm("Сохранить напоминание?\nНажмите Enter для сохранения.\nНажмите пробел для отмены.", remind, false);

            saveForm.ShowDialog();
            this.Close();
        }