Beispiel #1
0
        private void ConnectToReactors(object reaction, IManageResources resourceManager)
        {
            if (reaction.ImplementsInterface(typeof(IRxnPublisher <IRxn>)))
            {
                OnVerbose("Connecting Publisher", reaction.GetType());

                var page        = reaction as IRxnPublisher <IRxn>;
                var pageReactor = RxnCreator.GetReactorFor(page, name => _reactorManager.StartReactor(name).Reactor);

                pageReactor.Connect(page).DisposedBy(resourceManager);
            }

            if (reaction.ImplementsInterface(typeof(IReactTo <IRxn>)))
            {
                OnVerbose("Connecting ReactTo", reaction.GetType());

                var page        = reaction as IReactTo <IRxn>;
                var pageReactor = RxnCreator.GetReactorFor(page, name => _reactorManager.StartReactor(name).Reactor);

                pageReactor.Connect(page, RxnSchedulers.TaskPool).DisposedBy(resourceManager);
            }
        }
Beispiel #2
0
        public static T DisposedBy <T>(this T obj, IManageResources reporter) where T : IDisposable
        {
            reporter.OnDispose(obj);

            return(obj);
        }
Beispiel #3
0
        /**********************************************************/

        public void setCallback(IManageResources callback)
        {
            m_callbacks = callback;
        }