コード例 #1
0
ファイル: Form1.cs プロジェクト: JoelGallagher/TomatoTimer
        private void timerUI_Tick(object sender, EventArgs e)
        {
            var timeRemaining = getTimeRemaining();
            lblTimer.Text = string.Format("{0} : {1}", timeRemaining.ToString("mm"), timeRemaining.ToString("ss"));

            if (timeRemaining.TotalSeconds < 1)
            {
                timerUI.Stop();
                currentState = TomatoState.Stopped;
                MessageBox.Show("Done!");
                RefreshUI();
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: JoelGallagher/TomatoTimer
        private void Setup()
        {
            InitializeComponent();

            countdownMinutes = Convert.ToDouble(ConfigurationManager.AppSettings["CountdownMinutes"]);
            currentState = TomatoState.Stopped;

            RefreshUI();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: JoelGallagher/TomatoTimer
        private void StartTomato()
        {
            currentState = TomatoState.Started;
            countdownFinished = DateTime.Now.AddMinutes(countdownMinutes);
            currentBucket = new Bucket();

            timerUI.Start();
        }
コード例 #4
0
 static public Boolean setTomatoState(long userId, DateTime startTime, DateTime endTime, TomatoState state)
 {
     using (var db = SugarBase.GetIntance())
     {
         db.Updateable <History>()
         .SetColumns(it => new History()
         {
             status  = (int)state,
             endTime = endTime
         })
         .Where(it => it.userId == userId && it.startTime == startTime).ExecuteCommand();
         return(true);
     }
 }