예제 #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();
        }