|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace hmlib.Web.UI.Controls
{
public partial class Progress
{
public string ID { get; private set; }
private double? _value;
public double? Value
{
get { return this._value; }
private set
{
this._value = value;
this.ChangedOn = DateTime.Now;
}
}
public DateTime ChangedOn { get; private set; }
public DateTime CreatedOn { get; private set; }
private List<string> NewLines = new List<string>();
private Progress(string id)
{
this.ID = id;
this.Value = null;
this.ChangedOn = DateTime.Now;
this.CreatedOn = DateTime.Now;
Progress._list.Add(this);
Progress.CleanUp();
}
public bool SetProgress(double value)
{
this.Value = value;
return true;
}
public bool AddMessageLine(object msg)
{
if (msg == null) return false;
this.NewLines.Add(msg.ToString());
return true;
}
public bool AddMessageLines(string[] lines)
{
foreach (var line in lines)
{
this.AddMessageLine(line);
}
return true;
}
public object State { get; set; }
public void ClearProgress()
{
this.Value = null;
this.NewLines.Clear();
}
}
}
|
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.