Exemplo n.º 1
0
        private void UpdateRemainingEstimate(WorklogForm worklogForm)
        {
            RemainingEstimate        = "";
            RemainingEstimateSeconds = -1;

            if (cbJira.Text == "")
            {
                return;
            }
            if (!jiraClient.SessionValid)
            {
                return;
            }

            Task.Factory.StartNew(
                () =>
            {
                string key = "";
                this.InvokeIfRequired(
                    () => key = cbJira.Text
                    );

                TimetrackingFields timetracking = jiraClient.GetIssueTimetracking(key);
                if (timetracking == null)
                {
                    return;
                }

                this.InvokeIfRequired(
                    () => RemainingEstimate = timetracking.RemainingEstimate
                    );
                this.InvokeIfRequired(
                    () => RemainingEstimateSeconds = timetracking.RemainingEstimateSeconds
                    );
                if (worklogForm != null)
                {
                    this.InvokeIfRequired(
                        () => worklogForm.RemainingEstimate = timetracking.RemainingEstimate
                        );
                    this.InvokeIfRequired(
                        () => worklogForm.RemainingEstimateSeconds = timetracking.RemainingEstimateSeconds
                        );
                }
            }
                );
        }
Exemplo n.º 2
0
        private void btnPostAndReset_Click(object sender, EventArgs e)
        {
            using (var worklogForm = new WorklogForm(Comment))
            {
                var formResult = worklogForm.ShowDialog(this);
                if (formResult == DialogResult.OK)
                {
                    Comment = worklogForm.Comment.Trim();

                    PostAndReset(cbJira.Text, WatchTimer.TimeElapsed, Comment);
                }
                else if (formResult == DialogResult.Yes)
                {
                    Comment = string.Format("{0}:{1}{2}", DateTime.Now.ToString("g"), Environment.NewLine, worklogForm.Comment.Trim());
                    UpdateOutput();
                }
            }
        }
Exemplo n.º 3
0
        public void PostAndReset()
        {
            using (var worklogForm = new WorklogForm(WatchTimer.GetInitialStartTime(), WatchTimer.TimeElapsedNearestMinute, Comment, EstimateUpdateMethod, EstimateUpdateValue))
            {
                UpdateRemainingEstimate(worklogForm);
                var formResult = worklogForm.ShowDialog(this);
                if (formResult == DialogResult.OK)
                {
                    Comment = worklogForm.Comment.Trim();
                    EstimateUpdateMethod = worklogForm.estimateUpdateMethod;
                    EstimateUpdateValue  = worklogForm.EstimateValue;

                    PostAndReset(cbJira.Text, worklogForm.InitialStartTime, WatchTimer.TimeElapsedNearestMinute, Comment, EstimateUpdateMethod, EstimateUpdateValue);
                }
                else if (formResult == DialogResult.Yes)
                {
                    Comment = string.Format("{0}:{1}{2}", DateTime.Now.ToString("g"), Environment.NewLine, worklogForm.Comment.Trim());
                    EstimateUpdateMethod = worklogForm.estimateUpdateMethod;
                    EstimateUpdateValue  = worklogForm.EstimateValue;
                    UpdateOutput();
                }
            }
        }
Exemplo n.º 4
0
        private void UpdateRemainingEstimate(WorklogForm  worklogForm)
        {
            RemainingEstimate = "";
            RemainingEstimateSeconds = -1;

            if (cbJira.Text == "")
                return;
            if (!jiraClient.SessionValid)
                return;

            Task.Factory.StartNew(
                () =>
                {
                    string key = "";
                    TimetrackingFields timetracking = null;
                    this.InvokeIfRequired(
                        () => key = cbJira.Text
                    );
                    timetracking = jiraClient.GetIssueTimetracking(key);
                    this.InvokeIfRequired(
                        () => RemainingEstimate = timetracking.RemainingEstimate
                    );
                    this.InvokeIfRequired(
                        () => RemainingEstimateSeconds = timetracking.RemainingEstimateSeconds
                    );
                    if (worklogForm != null)
                    {
                        this.InvokeIfRequired(
                            () => worklogForm.RemainingEstimate = timetracking.RemainingEstimate
                        );
                        this.InvokeIfRequired(
                            () => worklogForm.RemainingEstimateSeconds = timetracking.RemainingEstimateSeconds
                        );
                    }
                }
            );
        }
Exemplo n.º 5
0
        private void btnPostAndReset_Click(object sender, EventArgs e)
        {
            using (var worklogForm = new WorklogForm(WatchTimer.TimeElapsed, settings.AllowManualEstimateAdjustments, Comment, EstimateUpdateMethod, EstimateUpdateValue))
            {
                UpdateRemainingEstimate(worklogForm);
                var formResult = worklogForm.ShowDialog(this);
                if (formResult == DialogResult.OK)
                {
                    Comment = worklogForm.Comment.Trim();
                    EstimateUpdateMethod = worklogForm.estimateUpdateMethod;
                    EstimateUpdateValue = worklogForm.EstimateValue;

                    PostAndReset(cbJira.Text, WatchTimer.TimeElapsed, Comment, EstimateUpdateMethod, EstimateUpdateValue);
                }
                else if (formResult == DialogResult.Yes)
                {
                    Comment = string.Format("{0}:{1}{2}", DateTime.Now.ToString("g"), Environment.NewLine, worklogForm.Comment.Trim());
                    EstimateUpdateMethod = worklogForm.estimateUpdateMethod;
                    EstimateUpdateValue = worklogForm.EstimateValue;
                    UpdateOutput();
                }
            }
        }
Exemplo n.º 6
0
 private void btnPostAndReset_Click(object sender, EventArgs e)
 {
     using (var worklogForm = new WorklogForm())
     {
         if (worklogForm.ShowDialog(this) == DialogResult.OK)
         {
             Cursor.Current = Cursors.WaitCursor;
             if (jiraClient.PostWorklog(cbJira.Text, WatchTimer.TimeElapsed, worklogForm.Comment))
                 Reset();
             Cursor.Current = DefaultCursor;
         }
     }
 }
Exemplo n.º 7
0
        private void btnPostAndReset_Click(object sender, EventArgs e)
        {
            using (var worklogForm = new WorklogForm(Comment))
            {
                var formResult = worklogForm.ShowDialog(this);
                if (formResult == DialogResult.OK)
                {
                    Comment = worklogForm.Comment.Trim();
                    Cursor.Current = Cursors.WaitCursor;
                    if (jiraClient.PostWorklog(cbJira.Text, WatchTimer.TimeElapsed, Comment))
                        Reset();
                    Cursor.Current = DefaultCursor;
                }
                else if (formResult == DialogResult.Yes)
                {
                    Comment = string.Format("{0}:{1}{2}", DateTime.Now.ToString("g"), Environment.NewLine, worklogForm.Comment.Trim());
                    UpdateOutput();
                }
            }

        }