Created
May 4, 2014 12:04
-
-
Save LinuxDoku/87bfcc58694fb33e179f to your computer and use it in GitHub Desktop.
MessageTask for Xamarin Bug Report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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