コード例 #1
0
        internal CompositeTypeWeaverBuilder(Type compositeType, INCopRegistry registry)
        {
            var mixinsMap              = new MixinsMap(compositeType);
            var aspectMappedMembers    = new AspectMemberMapper(compositeType, mixinsMap);
            var aspectsMap             = new AspectsMap(compositeType, aspectMappedMembers);
            var typeDefinitionWeaver   = new MixinsTypeDefinitionWeaver(compositeType, mixinsMap);
            var compositeMappedMembers = new CompositeMemberMapper(aspectsMap, aspectMappedMembers);
            var typeDefinition         = typeDefinitionWeaver.Weave();

            builder = new MixinsTypeWeaverBuilder(compositeType, typeDefinition, registry);

            mixinsMap.ForEach(map => {
                builder.Add(map);
            });

            compositeMappedMembers.Methods.ForEach(compositeMethodMap => {
                var methodBuilder = new CompositeMethodWeaverBuilder(compositeMethodMap, typeDefinition);

                builder.Add(methodBuilder);
            });

            compositeMappedMembers.Properties.ForEach(compositePropertyMap => {
                var propertyBuilder = new CompositePropertyWeaverBuilder(compositePropertyMap, typeDefinition);

                builder.Add(propertyBuilder);
            });
        }
コード例 #2
0
ファイル: CompositeContainer.cs プロジェクト: arieldeil/NCop
        public CompositeContainer(CompositeRuntimeSettings runtimeSettings = null)
        {
            INCopRegistry registry         = null;
            IRuntime      compositeRuntime = null;

            runtimeSettings  = runtimeSettings ?? CompositeRuntimeSettings.Empty;
            compositeAdapter = runtimeSettings.DependencyContainerAdapter ?? new CompositeContainerAdapter();
            registry         = new CompositeRegistryDecorator(compositeAdapter);
            compositeRuntime = new CompositeRuntime(runtimeSettings, registry);
            compositeRuntime.Run();
        }
コード例 #3
0
 internal MixinsWeaverStrategy(ITypeDefinition typeDefinition, IEnumerable <IMethodWeaver> methodWeavers, INCopRegistry registry)
 {
     this.registry       = registry;
     this.methodWeavers  = methodWeavers;
     this.typeDefinition = typeDefinition;
 }
コード例 #4
0
 public MixinsTypeWeaverBuilder(Type type, ITypeDefinition typeDefinition, INCopRegistry registry)
     : base(type, typeDefinition)
 {
     this.registry = registry;
     mixinsMap     = new HashSet <TypeMap>();
 }
コード例 #5
0
ファイル: NCopRegistryAdapter.cs プロジェクト: sagifogel/NCop
 public NCopRegistryAdapter(INCopRegistry registry)
 {
     this.registry = registry;
 }
コード例 #6
0
 public CompositeRuntime(IRuntimeSettings settings, INCopRegistry registry)
 {
     this.registry = registry;
     this.settings = settings ?? new RuntimeSettings();
 }
コード例 #7
0
 public CompositeRegistryDecorator(INCopRegistry regisrty)
 {
     this.regisrty = regisrty;
 }
コード例 #8
0
 public NCopRegistryAdapter(INCopRegistry registry)
 {
     this.registry = registry;
 }