public static LongIdBroker AsIdBroker(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <LongIdBroker>(); return(rv); }
public static BackgroundHost AsBackground(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <BackgroundHost>(); return(rv); }
public static HasAdjustment <T> AsHasAdjustment <T>(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <HasAdjustment <T> >(); return(rv); }
public static StrategizedTouchable AsStrategizedTouchable(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.AsHasTouchable(); return(rv.With(x => x.Touchable) as StrategizedTouchable); }
public static NaturalDatedExpirable AsDatedExpirable(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <NaturalDatedExpirable>(); return(rv); }
public static HasExpirable AsHasExpirable(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <HasExpirable>(); return(rv); }
public static ConditionalWaiter AsConditionalWaiter(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <ConditionalWaiter>(); return(rv); }
public static IItemValidator AsHasItemValidator(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <HasItemValidator>(); return(rv); }
public static NaturalThrottle AsThrottle(this Polyface root) { Condition.Requires(root).IsNotNull(); var rv = root.As <NaturalThrottle>(); return(rv); }
public static Polyface IsHasAdjustment <T>(this Polyface root, IAdjustment <T> adjustment) { Condition.Requires(root).IsNotNull(); var composited = new HasAdjustment <T>(adjustment); root.Is(composited); return(root); }
public static Polyface IsFloatingDatedExpirable(this Polyface root, DateTime expiry, int touchIncrementSecs) { Condition.Requires(root).IsNotNull(); var composited = new NaturalFloatingDatedExpirable(expiry, touchIncrementSecs); root.Is(composited); return(root); }
public static Polyface IsDatedExpirable(this Polyface root, DateTime expiry) { Condition.Requires(root).IsNotNull(); var composited = new NaturalDatedExpirable(expiry); root.Is(composited); return(root); }
public static Polyface IsConditionalExpirable(this Polyface root, IConditionOf <Polyface> expiry) { Condition.Requires(root).IsNotNull(); var composited = new NaturalConditionalExpirable(expiry.WithValue(root.AsNaturalValue())); root.Is(composited); return(root); }
public static Polyface IsThrottle(this Polyface root, int maxConcurrency) { Condition.Requires(root).IsNotNull(); var composited = new NaturalThrottle(maxConcurrency); root.Is(composited); return(root); }
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 static Polyface IsStrategizedTouchable(this Polyface root, ILogic logic) { Condition.Requires(root).IsNotNull(); var composited = new StrategizedTouchable(logic); root.IsHasTouchable(composited); return(root); }
public static Polyface IsCounter(this Polyface root) { Condition.Requires(root).IsNotNull(); var counter = new Counter(); root.Is(counter); return(root); }
public static Polyface IsHasExpirable(this Polyface root, IExpirable expirable) { Condition.Requires(root).IsNotNull(); var composited = new HasExpirable(expirable); root.Is(composited); return(root); }
public static Polyface IsBackground(this Polyface root, bool isEnabled, double backgroundIntervalMSecs, ILogic backgroundAction) { Condition.Requires(root).IsNotNull(); var bg = BackgroundHost.New(isEnabled, backgroundIntervalMSecs, backgroundAction); root.Is(bg); return(root); }
public static Polyface IsEmptyBackground(this Polyface root) { Condition.Requires(root).IsNotNull(); var bg = BackgroundHost.NewBlank(); root.Is(bg); return(root); }
public static Polyface IsHasItemValidator(this Polyface root, IItemValidator validator) { Condition.Requires(root).IsNotNull(); var obj = HasItemValidator.New(validator); root.Is(obj); return(root); }
public static Polyface IsIdBroker(this Polyface root, string generatorId, IStore store, int rangeSize = 1000, int maxRetries = 25) { Condition.Requires(root).IsNotNull(); var obj = new LongIdBroker(generatorId, store, rangeSize, maxRetries); root.Is(obj); return(root); }
public static IExpirable BuildTouchLimitExpirable(int limit) { //fluently build something that Counts, and has a condition on that count, and is touchable var pf = Polyface.New(); pf.IsCounter(); pf.IsConditionalExpirable(StrategizedConditionOf <Polyface> .New((pf1) => { return(pf1.AsCounter().Current > limit); })); pf.IsStrategizedTouchable(LogicOf <Polyface> .New((pf1) => { pf1.AsCounter().Increment(); })); //var expire = NaturalFalseExpirable.New().ExpiresWhen( .InWindow(startDate, endDate); // return expire; return(pf.AsConditionalExpirable()); }