public static Polyface IsConditionalWaiter(this Polyface root, ICondition condition, ICondition stopWaitingCondition) { Condition.Requires(root).IsNotNull(); var bg = new ConditionalWaiter(condition, stopWaitingCondition); root.Is(bg); return(root); }
public WaiterTest() : base(LogicOf <Nothing> .New((x) => { var flagDate = DateTime.Now.AddSeconds(5); ICondition cond = StrategizedCondition.New(() => { return(DateTime.Now < flagDate); }); ICondition expCond = StrategizedCondition.New(() => { return(DateTime.Now > flagDate.AddSeconds(1)); }); var waiter = ConditionalWaiter.New(cond, expCond); waiter.WaitAround(); })) { }
public static Polyface IsConditionalWaiter(this Polyface root, ICondition condition, ICondition stopWaitingCondition) { Condition.Requires(root).IsNotNull(); var bg = new ConditionalWaiter(condition, stopWaitingCondition); root.Is(bg); return root; }