Пример #1
0
 private void PauseCount()
 {
     CurrentState = Mode.PAUSED;
     UpdateButtonsState();
     TTimer.Stop();
     HideToTray.Pause();
 }
Пример #2
0
 private void TTClient_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (ClosaApp == false)
     {
         e.Cancel = true;
         this.Hide();
     }
     else
     {
         HideToTray.RemoveIcon();
     }
 }
Пример #3
0
        private void StopCount()
        {
            if (txtActTitle.Text == "")
            {
                MessageBox.Show("Update Activity Type", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            double _completedhours = Math.Round(CurrentMins / 60.0, 2);

            CurrentWi = RestApiHelper.GetWorkItem(CurrentWi.Id.Value);
            CreateNewActivity(_completedhours);
            UpdateParentWorkItem(_completedhours);

            CurrentState = Mode.STOPED;
            UpdateButtonsState();
            TTimer.Stop();
            HideToTray.InActive();
        }
Пример #4
0
        public MainWindow()
        {
            InitializeComponent();

            foreach (string _atitem in Properties.Settings.Default.ActivityTypes)
            {
                cmbActType.Items.Add(_atitem);
            }
            if (Properties.Settings.Default.LastActivityType != "")
            {
                cmbActType.Text = Properties.Settings.Default.LastActivityType;
            }

            LoadSettings();
            HideToTray.Enable(this);
            TTimer.Tick             += TTimer_Tick;
            TTimer.Interval          = new TimeSpan(0, 1, 0);
            ExceprionsTimer.Tick    += ExceprionsTimer_Tick;
            ExceprionsTimer.Interval = new TimeSpan(0, 0, 3);
            ExceprionsTimer.Start();
            CurrentState = Mode.STOPED;
            UpdateButtonsState();
            StartPressHook();
        }
Пример #5
0
        /// <summary>
        /// start count process for active workitem
        /// </summary>
        private void StartCount()
        {
            if (CurrentWi == null)
            {
                return;
            }

            if (CurrentState == Mode.PAUSED)
            {
                CurrentState = Mode.STARTED;
                UpdateButtonsState();
                TTimer.Start();
            }
            else
            {
                CurrentState = Mode.STARTED;
                StartTime    = DateTime.Now;
                CurrentMins  = 0;
            }

            UpdateButtonsState();
            TTimer.Start();
            HideToTray.Start();
        }