Beispiel #1
0
 void hookStartKeyPressed(object sender, KeyPressedEventArgs e)
 {
     if (isTracking)
     {
         Toggl.Stop();
     }
     else
     {
         Toggl.ContinueLatest();
     }
 }
Beispiel #2
0
 void hookStartKeyPressed(object sender, KeyPressedEventArgs e)
 {
     if (isTracking)
     {
         Toggl.Stop();
     }
     else
     {
         if (this.manualMode)
         {
             var guid = Toggl.Start("", "0", 0, 0, "", "");
             Toggl.Edit(guid, false, Toggl.Duration);
         }
         else
         {
             Toggl.ContinueLatest();
         }
     }
 }
Beispiel #3
0
 public static void StartTimeEntry(bool continueIfNotInManualMode = false,
                                   string description             = "", bool preventOnApp = false)
 {
     if (isInManualMode)
     {
         var guid = Toggl.Start(description, "0", 0, 0, "", "");
         Toggl.Edit(guid, false, Toggl.Duration);
     }
     else
     {
         if (continueIfNotInManualMode)
         {
             Toggl.ContinueLatest(preventOnApp);
         }
         else
         {
             Toggl.Start(description, "", 0, 0, "", "", preventOnApp);
         }
     }
 }
Beispiel #4
0
        private void OnDisplayPomodoro(string title, string informativeText)
        {
            if (_parentWindow.TryBeginInvoke(OnDisplayPomodoro, title, informativeText))
            {
                return;
            }

            void StartNewButtonClick()
            {
                _taskbarIcon.CloseBalloon();
                var guid = Toggl.Start("", "", 0, 0, "", "", true);

                _parentWindow.ShowOnTop();
                if (guid != null)
                {
                    Toggl.Edit(guid, true, Toggl.Description);
                }
            }

            void ContinueLatestButtonClick()
            {
                _taskbarIcon.CloseBalloon();
                Toggl.ContinueLatest(true);
            }

            var pomodoroNotification = new PomodoroNotification(
                _taskbarIcon.CloseBalloon, _parentWindow.ShowOnTop, StartNewButtonClick, ContinueLatestButtonClick)
            {
                Message = informativeText,
                Title   = title
            };

            if (!_taskbarIcon.ShowNotification(pomodoroNotification, PopupAnimation.Slide, null))
            {
                _taskbarIcon.ShowBalloonTip(title, informativeText, Properties.Resources.toggl, largeIcon: true);
            }
            else
            {
                System.Media.SystemSounds.Asterisk.Play();
            }
        }
Beispiel #5
0
 private static void onContinue(object sender, RoutedEventArgs e)
 {
     Toggl.ContinueLatest(sender is MiniTimerWindow);
 }
Beispiel #6
0
 private void onContinueButtonClick(object sender, RoutedEventArgs e)
 {
     this.icon.CloseBalloon();
     Toggl.ContinueLatest(true);
 }
Beispiel #7
0
 private void continueToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Toggl.ContinueLatest();
 }
 private void onDiscardContinueClick(object sender, RoutedEventArgs e)
 {
     Toggl.DiscardTimeAt(this.guid, this.started, false);
     Toggl.ContinueLatest();
     this.Hide();
 }