|
using System;
using System.Globalization;
namespace Kaleida.ServiceMonitor.Framework
{
public class Duration
{
private readonly double value;
private readonly string suffix;
public static Duration Parse(string text)
{
return text.ToDuration();
}
public Duration(double value, string suffix)
{
this.value = value;
this.suffix = suffix;
}
public double Value
{
get { return value; }
}
public string Suffix
{
get { return suffix; }
}
public override string ToString()
{
return suffix == "" ? value.ToString(CultureInfo.InvariantCulture) : string.Format("{0} {1}", value, suffix);
}
}
}
|
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.
Stuart Wheelwright is the Principal Architect and Software Developer at
BlackJet Software Ltd.
He has over 16 years commercial experience producing robust, maintainable, web-based solutions and bespoke systems for Microsoft platforms.
His latest project is
Shopping UK, an elegantly simple shopping list for iPhone.