|
// This file is part of the ProgressTracker library
// Copyright: Andreas Raczek
// This file is published under the The Code Project Open License (CPOL)
// See the file "CPOL.html" for the full license governing this code.
namespace ProgressTracker
{
/// <summary>
/// Represents an array of equal-sized progress steps
/// </summary>
public class EvenSteps : IWeightedSteps
{
/// <summary>
/// Initializes a new instance of the EvenSteps class.
/// Should be used in the form <code>IProgressUpdater.createSteps(new EvenSteps(200));</code>
/// </summary>
/// <param name="stepCount">The number of steps for this Updater.</param>
public EvenSteps(int stepCount)
{
this.Length = stepCount;
}
/// <summary>
/// <see cref="IWeightedSteps.Length"/>
/// </summary>
public int Length
{
get;
private set;
}
/// <summary>
/// <see cref="IWeightedSteps.SumWeight"/>
/// </summary>
public double SumWeight
{
get { return 1.0; }
}
/// <summary>
/// <see cref="IWeightedSteps.this"/>
/// </summary>
public double this[int index]
{
get
{
return 1.0d / this.Length;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.