Skip to content

Commit

Permalink
Issue #60 fixed: Total time now updated instantly upon editing a timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Gehling committed Mar 19, 2017
1 parent 0843d42 commit 9b7787e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/StopWatch/UI/IssueControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public bool Current
public event EventHandler RemoveMeTriggered;

public event EventHandler Selected;

public event EventHandler TimeEdited;
#endregion


Expand Down Expand Up @@ -698,6 +700,8 @@ public void EditTime()
WatchTimer.TimeElapsed = editTimeForm.Time;

UpdateOutput();

TimeEdited?.Invoke(this, new EventArgs());
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions source/StopWatch/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ private void InitializeIssueControls()
issue.TimerStarted += issue_TimerStarted;
issue.TimerReset += Issue_TimerReset;
issue.Selected += Issue_Selected;
issue.TimeEdited += Issue_TimeEdited;
this.pMain.Controls.Add(issue);
}

Expand Down Expand Up @@ -397,6 +398,11 @@ private void InitializeIssueControls()
UpdateIssuesOutput(true);
}

private void Issue_TimeEdited(object sender, EventArgs e)
{
UpdateTotalTime();
}

private void Issue_Selected(object sender, EventArgs e)
{
IssueSetCurrentByControl((IssueControl)sender);
Expand Down

0 comments on commit 9b7787e

Please sign in to comment.