예제 #1
0
        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);
        }
예제 #2
0
 public EventPredicator(Func <T, bool> predicate, Action <Action <T> > subscribe, Action <Action <T> > unsubscribe)
 {
     PredicateSubscriber <T> .CreateAndSubscribe(predicate, this.OnSatisfied, subscribe, unsubscribe);
 }