Exemplo n.º 1
0
        private AopProxyFactory()
        {
            Config = AopProxyConfig.Load();
            if (Config == null)
            {
                Config = new AopProxyConfig();
            }

            TypeMap = new Dictionary <Type, IAdvice>();
            foreach (var advConfig in Config.Advisors)
            {
                Type    pointCutType = AopProxyFactory.LoadType(advConfig.PointCutType);
                Type    adviceType   = AopProxyFactory.LoadType(advConfig.AdviseType);
                IAdvice advice       = Activator.CreateInstance(adviceType) as IAdvice;

                TypeMap[pointCutType] = advice;
            }
        }
Exemplo n.º 2
0
        public void TestLoad()
        {
            var config = AopProxyConfig.Load();

            Assert.IsNotNull(config);
        }