Created
May 9, 2016 07:28
-
-
Save xoposhiy/4cf8d1b247a022263d0f1ba898063f1a to your computer and use it in GitHub Desktop.
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 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