public static PredicateSubscriber <T> CreateAndSubscribe(Func <T, bool> predicate, Action <T> onSatisfied, Action <Action <T> > subscribe, Action <Action <T> > unsubscribe) { var subscriber = new PredicateSubscriber <T>(predicate, onSatisfied, subscribe, unsubscribe); subscriber.Subscribe(); return(subscriber); }
public EventPredicator(Func <T, bool> predicate, Action <Action <T> > subscribe, Action <Action <T> > unsubscribe) { PredicateSubscriber <T> .CreateAndSubscribe(predicate, this.OnSatisfied, subscribe, unsubscribe); }