Skip to content

Commit

Permalink
#27 make percent function protected
Browse files Browse the repository at this point in the history
  • Loading branch information
msevestre committed Nov 28, 2019
1 parent dc46dcb commit ab23fdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OSPSuite.Utility/Events/ProgressUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public virtual void Initialize(int numberOfIterations, string message)
public virtual void ReportProgress(int iteration, int numberOfIterations, string message)
{
_currentIteration = iteration;
_eventPublisher.PublishEvent(new ProgressingEvent(iteration, percentFrom(iteration, numberOfIterations), message));
_eventPublisher.PublishEvent(new ProgressingEvent(iteration, PercentFrom(iteration, numberOfIterations), message));
}

public virtual void ReportStatusMessage(string message) => _eventPublisher.PublishEvent(new StatusMessageEvent(message));

private int percentFrom(int iteration, int numberOfIterations)
protected virtual int PercentFrom(int iteration, int numberOfIterations)
{
return (int) Math.Floor((double) iteration * 100 / numberOfIterations);
}
Expand Down

0 comments on commit ab23fdb

Please sign in to comment.