Esempio n. 1
0
        protected override void EstablishContext()
        {
            InnerBefore = new ManualResetEvent(false);
            InnerAfter  = new ManualResetEvent(false);

            using (var scope = Input.NewSubscriptionScope())
            {
                scope.Intercept <object>(x =>
                {
                    x.BeforeEachMessage(() => BeforeCalled.Set());
                    x.AfterEachMessage(message => AfterCalled.Set());
                });

                using (var innerScope = Input.NewSubscriptionScope())
                {
                    innerScope.Intercept <object>(x =>
                    {
                        x.BeforeEachMessage(() => InnerBefore.Set());
                        x.AfterEachMessage(message => InnerAfter.Set());
                    });

                    Input.Send(new ClaimModified());
                }
            }
        }
Esempio n. 2
0
        protected override void EstablishContext()
        {
            using (var scope = Input.NewSubscriptionScope())
            {
                scope.Intercept <object>(x =>
                {
                    x.BeforeEachMessage(() => BeforeCalled.Set());
                    x.AfterEachMessage(message => AfterCalled.Set());
                });
            }

            Input.Send(new ClaimModified());
        }