using System; using System.Diagnostics; namespace m3uTool.Tests { /// /// Implements the interface progress callback for testing output purposes /// public class ProgressCallbackTestBase : IProgressCallback { protected string mPreface = ""; #region IProgressCallback Members /// /// Call this method from the worker thread to initialize /// the progress callback. /// /// The minimum. /// The maximum. public virtual void Begin(int minimum, int maximum) { Debug.WriteLine(mPreface + String.Format("Begin min:{0} max:{1}", minimum, maximum)); } /// /// Call this method from the worker thread to initialize /// the progress callback, without setting the range /// public virtual void Begin() { Debug.WriteLine(mPreface + String.Format("Begin")); } /// /// Call this method from the worker thread to reset the range in the /// progress callback /// /// The minimum. /// The maximum. public virtual void SetRange(int minimum, int maximum) { Debug.WriteLine(mPreface + String.Format("SetRange min:{0} max:{1}", minimum, maximum)); } /// /// Call this method from the worker thread to update the progress text. /// /// The text. public virtual void SetText(string text) { Debug.WriteLine(mPreface + String.Format("SetText : {0}", text)); } /// /// Call this method from the worker thread to increase the progress /// counter by a specified value. /// /// The val. public virtual void StepTo(int val) { Debug.WriteLine(mPreface + String.Format("StepTo : {0}", val)); } /// /// Call this method from the worker thread to step the progress meter to a /// particular value. /// /// The val. public virtual void Increment(int val) { Debug.WriteLine(mPreface + String.Format("Increment : {0}", val)); } /// /// If this property is true, then you should abort work /// /// /// true if this instance is aborting; otherwise, false. /// public virtual bool IsAborting { get { Debug.WriteLine(mPreface + "IsAborting"); return false; } } /// /// Call this method from the worker thread to finalize the progress meter /// public virtual void End() { Debug.WriteLine(mPreface + "End"); } #endregion } }