Skip to content

Instantly share code, notes, and snippets.

@LinuxDoku
Created May 4, 2014 12:04
Show Gist options
  • Save LinuxDoku/87bfcc58694fb33e179f to your computer and use it in GitHub Desktop.
Save LinuxDoku/87bfcc58694fb33e179f to your computer and use it in GitHub Desktop.
MessageTask for Xamarin Bug Report
using System;
using TaskProcessor.Contracts;
namespace TaskProcessor.Tasks
{
/// <summary>
/// A simple task which prints a message to stdout.
/// </summary>
public class MessageTask : ITask
{
protected TaskStatus _taskStatus = TaskStatus.INITIAL;
public MessageTask(string message) {
Message = message;
}
/// <summary>
/// The message to print.
/// </summary>
/// <value>The message.</value>
public string Message { get; set; }
#region ITask implementation
/// <summary>
/// Get the task's name.
/// </summary>
/// <value>The name.</value>
public string Name {
get {
return "MessageTask";
}
}
/// <summary>
/// Execute this task. And change the task status if it was successful.
/// </summary>
public void Execute()
{
Console.WriteLine(Message);
TaskStatus = TaskStatus.SUCCESSFUL;
}
/// <summary>
/// Get the current task status.
/// </summary>
/// <value>The task status.</value>
public TaskStatus TaskStatus { get; set; }
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment