using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Build.Windows.Config.Tasks
{
///
/// Represents a simple task.
///
public abstract class Task
{
///
/// Occurs when the task has a status message.
///
public event EventHandler Status;
///
/// Gets the name of the task.
///
public abstract string Name { get; }
///
/// Executes the task.
///
public abstract void Execute();
///
/// Occurs when a status message is received.
///
///
///
protected void OnStatus(float percentage, string message)
{
TaskStatusEventArgs args = new TaskStatusEventArgs();
args.TaskName = Name;
args.Percentage = percentage;
args.Message = message;
if (Status != null)
Status(this, args);
}
}
///
/// Represents the current task's status.
///
public class TaskStatusEventArgs : EventArgs
{
public string Message { get; set; }
public string TaskName { get; set; }
public float Percentage { get; set; }
}
}