Пример #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))));
        }
Пример #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)))));
        }
Пример #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)));
        }