コード例 #1
0
ファイル: ProxyWeaver.cs プロジェクト: mfkl/StaticProxy.Fody
        public static void Execute()
        {
            IEnumerable <TypeDefinition> typesToProxy = WeavingInformation.ModuleDefinition.Types
                                                        .Where(HasStaticProxyAttribute)
                                                        .ToList();

            var constructorWeaver = new ConstructorWeaver();
            var methodWeaver      = new MethodWeaver();

            var interfaceImplementationWeaver = new InterfaceImplementationWeaver(constructorWeaver, methodWeaver);
            var classDecorationWeaver         = new ClassDecorationWeaver(constructorWeaver, methodWeaver);

            ImplementInterfaces(
                typesToProxy.Where(x => x.IsInterface),
                interfaceImplementationWeaver);

            DecorateClasses(classDecorationWeaver, typesToProxy.Where(x => x.IsClass).ToList());
        }
コード例 #2
0
        public static void Execute()
        {
            IEnumerable<TypeDefinition> typesToProxy = WeavingInformation.ModuleDefinition.Types
                .Where(HasStaticProxyAttribute)
                .ToList();

            var constructorWeaver = new ConstructorWeaver();
            var methodWeaver = new MethodWeaver();

            var interfaceImplementationWeaver = new InterfaceImplementationWeaver(constructorWeaver, methodWeaver);
            var classDecorationWeaver = new ClassDecorationWeaver(constructorWeaver, methodWeaver);

            ImplementInterfaces(
                typesToProxy.Where(x => x.IsInterface),
                interfaceImplementationWeaver);

            DecorateClasses(classDecorationWeaver, typesToProxy.Where(x => x.IsClass).ToList());
        }