Skip to content

Commit

Permalink
FlatToHierarchicalProgressMonitor: one less field
Browse files Browse the repository at this point in the history
  • Loading branch information
pescuma committed Apr 30, 2014
1 parent a358397 commit 8b3a78f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class FlatToHierarchicalProgressMonitor : ProgressMonitor
private readonly FlatToHierarchicalProgressMonitor parent;
private readonly string[] name;

private bool configured;
private int[] steps;
private int currentStep = -1;
private string currentStepName;
Expand Down Expand Up @@ -72,9 +71,8 @@ private FlatToHierarchicalProgressMonitor(FlatToHierarchicalProgressMonitor pare

public IDisposable ConfigureSteps(params int[] aSteps)
{
if (configured)
if (WasConfigured)
throw new InvalidOperationException("Alteady configured");
configured = true;

if (aSteps.Length < 1)
throw new ArgumentException();
Expand All @@ -99,6 +97,11 @@ public IDisposable ConfigureSteps(params int[] aSteps)
});
}

private bool WasConfigured
{
get { return steps != null; }
}

private bool HasStarted
{
get { return currentStep >= 0; }
Expand Down

0 comments on commit 8b3a78f

Please sign in to comment.