Ejemplo n.º 1
0
        public IActivator Intercept(ActivatorCallback callback)
        {
            ActivatorCallback cb = (self, signal) =>
            {
                if (self.Blocking)
                {
                    self.Unblock();
                }
                else
                {
                    self.Block();
                    callback.Invoke(self, signal);
                }
            };
            var activator = this.Subscribe(cb);

            return(activator);
        }
Ejemplo n.º 2
0
        public IActivator Intercept(EventScope scope, String callNext, ActivatorCallback callback)
        {
            ActivatorCallback cb = (self, signal) =>
            {
                if (self.Blocking)
                {
                    self.Unblock();
                }
                else
                {
                    self.Block();
                    callback.Invoke(self, signal);
                    scope.Raise(callNext);
                }
            };
            var activator = this.Subscribe(cb);

            return(activator);
        }