示例#1
0
        public void AddLogging()
        {
            var commandHandler   = new SlowRunningCommandHandler();
            var loggingDecorator = new LoggingDecorator <SlowRunningCommand>(commandHandler);

            loggingDecorator.Handle(new SlowRunningCommand(1234));
        }
示例#2
0
        public void MeasureTime()
        {
            var commandHandler  = new SlowRunningCommandHandler();
            var timedDecorator  = new TimedDecorator <SlowRunningCommand>(commandHandler);
            var loggedDecorator = new LoggingDecorator <SlowRunningCommand>(timedDecorator);

            loggedDecorator.Handle(new SlowRunningCommand(1234));
        }