/// <summary>
        /// Mode 変更のコールバック
        /// </summary>
        /// <param name="emMode"></param>
        private void CallBackStartAction(Em_Mode emMode)
        {
            EmMode = emMode;
            if (EmMode == Em_Mode.Working)
            {
                _taskRecorderTimer.ResetTimer();
                TimeInterval timeInterval = _repository.Load();
                _taskRecorderTimer.StartTimer(timeInterval.WorkInterval);

                toolStripMenuItem_Start.Visible = false;
                toolStripMenuItem_Break.Visible = true;

                System.ComponentModel.ComponentResourceManager resources =
                    new System.ComponentModel.ComponentResourceManager(typeof(NotifyIconWrapper));
                toolStripMenuItem_TimeText.Image = ((System.Drawing.Image)(resources.GetObject("Start")));
            }
            else if (EmMode == Em_Mode.Break)
            {
                _taskRecorderTimer.ResetTimer();
                TimeInterval timeInterval = _repository.Load();
                _taskRecorderTimer.StartTimer(timeInterval.BreakInterval);

                toolStripMenuItem_Start.Visible = true;
                toolStripMenuItem_Break.Visible = false;

                System.ComponentModel.ComponentResourceManager resources =
                    new System.ComponentModel.ComponentResourceManager(typeof(NotifyIconWrapper));
                toolStripMenuItem_TimeText.Image = ((System.Drawing.Image)(resources.GetObject("Break")));
            }
            else
            {
                toolStripMenuItem_Start.Visible = true;
                toolStripMenuItem_Break.Visible = true;
            }
        }
예제 #2
0
 public EndPomodoroVM(PomodoroTimer pomodoroTimer)
     : base(Messenger.Default)
 {
     _emMode        = Em_Mode.Stop;
     _pomodoroTimer = pomodoroTimer;
     _pomodoroTimer.PropertyChanged   += EmMode_PropertyChanged;
     PushedPomodoroActionButtonCommand = new PomodoroActionCommand(_pomodoroTimer);
 }
예제 #3
0
        /// <summary>
        /// コンテキストメニュー "Start Pomodoro" を選択したとき呼ばれます。
        /// </summary>
        /// <param name="sender">呼び出し元オブジェクト</param>
        /// <param name="e">イベントデータ</param>
        private void toolStripMenuItem_Start_Click(object sender, EventArgs e)
        {
            EmMode = Em_Mode.Pomodoro;
            _pomodoroTime.ResetTimer();
            _pomodoroTime.StartTimer(_emMode);
            toolStripMenuItem_Start.Visible     = false;
            toolStripMenuItem_Break.Visible     = true;
            toolStripMenuItem_LongBreak.Visible = true;

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotifyIconWrapper));
            toolStripMenuItem_TimeText.Image = ((System.Drawing.Image)(resources.GetObject("toolStripMenuItem_Start.Image")));
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Em_Mode emMode = (Em_Mode)value;

            switch (emMode)
            {
            case Em_Mode.Pomodoro:
                return(END_POMODORO_MSG);

            case Em_Mode.Break:
                return(END_BREAK_MSG);

            case Em_Mode.LongBreak:
                return(END_LONG_BREAK_MSG);
            }
            return("Select Action");
        }
 /// <summary>
 /// タイマースタート
 /// </summary>
 public void StartTimer(Em_Mode emMode)
 {
     EmMode    = emMode;
     StartTime = DateTime.Now;
     dispatcherTimer.Start();
 }