コード例 #1
0
        private void OnReminder(string title, string informativeText)
        {
            if (_parentWindow.TryBeginInvoke(OnReminder, title, informativeText))
            {
                return;
            }

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

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

            var reminder =
                new ReminderNotification(_taskbarIcon.CloseBalloon, _parentWindow.ShowOnTop, StartButtonClick)
            {
                Title = title, Message = informativeText
            };

            if (!_taskbarIcon.ShowNotification(reminder, PopupAnimation.Slide, TimeSpan.FromSeconds(10)))
            {
                _taskbarIcon.ShowBalloonTip(title, informativeText, Properties.Resources.toggl, largeIcon: true);
            }
        }
コード例 #2
0
        public static void CreateAndEditRunningTimeEntryFrom(ulong started)
        {
            var teId = Toggl.Start("", "", 0, 0, "", "");

            Toggl.SetTimeEntryStartTimeStampWithOption(teId, (long)started, true);
            Toggl.Edit(teId, true, Toggl.Description);
        }
コード例 #3
0
 private void openEditView(MouseButtonEventArgs e, string focusedField)
 {
     using (Performance.Measure("opening edit view from cell, focussing " + focusedField))
     {
         Toggl.Edit(this.guid, false, focusedField);
     }
     e.Handled = true;
 }
コード例 #4
0
 private void tryOpenEditViewIfRunning(MouseButtonEventArgs e, string focusedField)
 {
     if (this.isRunning)
     {
         using (Performance.Measure("opening edit view from timer, focussing " + focusedField))
         {
             Toggl.Edit(this.runningTimeEntry.GUID, false, focusedField);
         }
         e.Handled = true;
     }
 }
コード例 #5
0
 private static void onEditRunning(object sender, RoutedEventArgs e)
 {
     if (isInManualMode)
     {
         StartTimeEntry();
     }
     else
     {
         Toggl.Edit(null, true, null);
     }
 }
コード例 #6
0
        private void onStartButtonClick(object sender, RoutedEventArgs e)
        {
            this.icon.CloseBalloon();
            var guid = Toggl.Start("", "", 0, 0, "", "", true);

            this.mainWindow.ShowOnTop();
            if (guid != null)
            {
                Toggl.Edit(guid, true, Toggl.Description);
            }
        }
コード例 #7
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.manualMode)
     {
         var guid = Toggl.Start("", "0", 0, 0, "", "");
         Toggl.Edit(guid, false, Toggl.Duration);
     }
     else
     {
         Toggl.Start("", "", 0, 0, "", "");
     }
 }
コード例 #8
0
 private void openEditView(MouseButtonEventArgs e, string focusedField)
 {
     if (group)
     {
         Toggl.ToggleEntriesGroup(groupName);
         e.Handled = true;
         return;
     }
     using (Performance.Measure("opening edit view from cell, focussing " + focusedField))
     {
         Toggl.Edit(this.guid, false, focusedField);
     }
     e.Handled = true;
 }
コード例 #9
0
        private void onHighlightEdit(object sender, ExecutedRoutedEventArgs e)
        {
            if (this.tryExpandSelectedDay())
            {
                return;
            }

            if (!this.hasKeyboardSelection)
            {
                return;
            }

            Toggl.Edit(this.keyboardHighlightedGUID, false, "");
        }
コード例 #10
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();
         }
     }
 }
コード例 #11
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);
         }
     }
 }
コード例 #12
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();
            }
        }
コード例 #13
0
        private void textBoxDuration_Click(object sender, EventArgs e)
        {
            durationFocused = true;
            string descriptionText = "";

            if (descriptionTextBox.Text != defaultDescription)
            {
                descriptionText = descriptionTextBox.Text;
            }
            string GUID = Toggl.Start(
                descriptionText,
                defaultDuration,
                task_id,
                project_id);

            if (GUID != null)
            {
                task_id    = 0;
                project_id = 0;
                labelClearProject.Visible = false;
                Toggl.Edit(GUID, false, Toggl.Duration);
            }
        }
コード例 #14
0
ファイル: TimeEntryCell.cs プロジェクト: Hazer/toggldesktop
 private void edit_Click(object sender, EventArgs e)
 {
     Toggl.Edit(GUID, false, "");
 }
コード例 #15
0
ファイル: TimeEntryCell.cs プロジェクト: Hazer/toggldesktop
 private void labelDuration_Click(object sender, EventArgs e)
 {
     Toggl.Edit(GUID, false, Toggl.Duration);
 }
コード例 #16
0
        public static void CreateAndEditTimeEntry(ulong started, ulong ended)
        {
            var teId = Toggl.CreateEmptyTimeEntry(started, ended);

            Toggl.Edit(teId, false, Toggl.Description);
        }
コード例 #17
0
 private void linkLabelProject_Click(object sender, EventArgs e)
 {
     Toggl.Edit("", true, Toggl.Project);
 }
コード例 #18
0
 private void linkLabelDuration_Click(object sender, EventArgs e)
 {
     Toggl.Edit("", true, Toggl.Duration);
 }
コード例 #19
0
ファイル: TimeEntryCell.cs プロジェクト: Hazer/toggldesktop
 private void project_Click(object sender, EventArgs e)
 {
     Toggl.Edit(GUID, false, Toggl.Project);
 }
コード例 #20
0
        private void onManualAddButtonClick(object sender, RoutedEventArgs e)
        {
            var guid = Toggl.Start("", "0", 0, 0, "", "", this.PreventOnApp);

            Toggl.Edit(guid, false, Toggl.Duration);
        }
コード例 #21
0
ファイル: TimeEntryCell.cs プロジェクト: Hazer/toggldesktop
 private void TimeEntryCellWithHeader_MouseClick(object sender, MouseEventArgs e)
 {
     Toggl.Edit(GUID, false, "");
 }