Note: The purpose of this video is to briefly demonstrate the essence of the command pattern. The resulting code (below) is written for brevity/simplicity and so is not necessarily optimal for production.
public class WriteToConsoleCommand
{
public void Execute()
{
Console.WriteLine("Write To Command Line");
}
}
class Program
{
static void Main(string[] args)
{
WriteToConsoleCommand command = new WriteToConsoleCommand();
Console.WriteLine("Starting");
command.Execute();
Thread.Sleep(500);
command.Execute();
Console.Read();
}
}