예제 #1
0
        public AgreeForm(string textToShow, Remind remind, bool isDeleted)
        {
            InitializeComponent();
            this.remind    = remind;
            this.isDeleted = isDeleted;
            textLabel.Text = textToShow;

            this.KeyDown += Form5_SpaceDown;
            this.KeyDown += Form5_EnterDown;
        }
예제 #2
0
        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();
        }
예제 #3
0
        void timerEvent(Object source, System.Timers.ElapsedEventArgs e)
        {
            remindRange = remindRange.updateRemindList();
            if (remindRange == null)
            {
                return;
            }

            for (int i = 0; i < remindRange.remindList.Count; ++i)
            {
                Remind   remind       = remindRange.remindList[i];
                DateTime current_time = DateTime.Now;
                DateTime remind_time  = remind.getDateTime();
                TimeSpan delta        = current_time - remind_time;
                if ((delta.TotalSeconds >= 0) && (delta.TotalSeconds < 60))
                {
                    remindRange.removeMessage(i);
                    System.Windows.Forms.MessageBox.Show(remind.getMessage());
                }
            }
        }
예제 #4
0
 public void setData(Remind remindToShow)
 {
     dateAndTime.Value  = remindToShow.getDateTime();
     RemindMessage.Text = remindToShow.getMessage();
 }
예제 #5
0
        public void addRemind(Remind remind)
        {
            RemindRange allReminds = new RemindRange();

            allReminds.addMessage(remind.getDateTime(), remind.getMessage());
        }
예제 #6
0
        public void deleteRemind(Remind remind)
        {
            RemindRange allReminds = new RemindRange();

            allReminds.removeMessage(remind.getId());
        }