2007-04-16 17:18:16 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
namespace Nuclex.Support.Tracking {
|
|
|
|
|
|
|
|
/// <summary>Base class for observable operations running in the background</summary>
|
|
|
|
public abstract class Operation : Progression {
|
|
|
|
|
2007-04-16 18:31:59 +00:00
|
|
|
/// <summary>Executes the operation</summary>
|
2007-05-02 19:25:21 +00:00
|
|
|
public abstract void Start();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Executes the operation synchronously, blocking the calling thread
|
|
|
|
/// </summary>
|
|
|
|
public virtual void Execute() {
|
|
|
|
Start();
|
|
|
|
WaitHandle.WaitOne();
|
|
|
|
}
|
2007-04-16 17:18:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Nuclex.Support.Tracking
|