Esempio n. 1
0
        public static FluentPropertyRegistration <TData> ThenFlow <TData>(this FluentPropertyRegistration <TData> prop, IExposedReceiveActor owner, Action <ActorFlowBuilder <TData> > flowBuilder)
        {
            var aFlow = new ActorFlowBuilder <TData>(owner);

            flowBuilder(aFlow);

            return(aFlow.OnTrigger(ent => prop.OnChange(v => ent(v))));
        }
Esempio n. 2
0
        public static FluentPropertyRegistration <TData> ThenFlow <TData, TConvert>(this FluentPropertyRegistration <TData> prop, Func <TData, TConvert> converter,
                                                                                    IExposedReceiveActor owner, Action <ActorFlowBuilder <TConvert> > flowBuilder)
        {
            var aFlow = new ActorFlowBuilder <TConvert>(owner);

            flowBuilder(aFlow);

            return(aFlow.OnTrigger(flow => prop.OnChange(v => flow(converter(v)))));
        }
Esempio n. 3
0
        public static FluentPropertyRegistration <TData> WithFlow <TData>(this FluentPropertyRegistration <TData> prop,
                                                                          Func <IObservable <TData>, IDisposable> flowBuilder)
        {
            var aFlow = new Subject <TData>();

            prop.Actor.AddResource(flowBuilder(aFlow.AsObservable()));
            prop.Actor.AddResource(aFlow);

            return(prop.OnChange(d => aFlow.OnNext(d)));
        }