Skip to content

Instantly share code, notes, and snippets.

@xoposhiy
Created May 9, 2016 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xoposhiy/4cf8d1b247a022263d0f1ba898063f1a to your computer and use it in GitHub Desktop.
Save xoposhiy/4cf8d1b247a022263d0f1ba898063f1a to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Threading;
namespace FluentTask
{
internal class Program
{
private static void Main()
{
var behaviour = new Behavior()
.Say("Привет мир!")
.UntilKeyPressed(b => b
.Say("Ля-ля-ля!")
.Say("Тру-лю-лю"))
.UntilKeyPressed(b => b
.Say("Aa-a-a-a-aaaaaa!!!")
.Say("[набирает воздух в легкие]"))
.Say("Ой!")
.Delay(TimeSpan.FromSeconds(1))
.Say("Кто здесь?!")
.Delay(TimeSpan.FromMilliseconds(2000));
behaviour.Execute();
}
}
public class Behavior
{
private readonly List<Action> actions = new List<Action>();
public void Execute()
{
}
public Behavior Say(string message)
{
}
public Behavior Delay(TimeSpan timeout)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment