Ejemplo n.º 1
0
    public void Execute()
    {
        var freezableTypeFinder = new FreezableTypeFinder(ModuleDefinition, AssemblyResolver);

        freezableTypeFinder.Execute();

        var exceptionFinder = new ExceptionFinder(ModuleDefinition, AssemblyResolver);

        exceptionFinder.Execute();

        var volatileFinder = new VolatileTypeFinder(ModuleDefinition, AssemblyResolver);

        volatileFinder.Execute();

        var volatileFieldFixer    = new VolatileFieldFixer(volatileFinder);
        var fieldInjector         = new FieldInjector(volatileFinder, ModuleDefinition.TypeSystem, volatileFieldFixer);
        var checkIsFrozenBuilder  = new CheckIsFrozenBuilder(ModuleDefinition.TypeSystem, exceptionFinder);
        var freezeCheckerInjector = new FreezeCheckerInjector(ModuleDefinition, fieldInjector, checkIsFrozenBuilder);

        var typeResolver = new TypeResolver();
        var implementsInterfaceFinder = new ImplementsInterfaceFinder(typeResolver);

        var classes = ModuleDefinition.GetTypes()
                      .Where(x => x.IsClass)
                      .ToList();
        var assemblyProcessor = new AssemblyProcessor(freezeCheckerInjector, implementsInterfaceFinder, LogInfo);

        assemblyProcessor.Execute(classes);

        volatileFieldFixer.Execute(classes);
    }
Ejemplo n.º 2
0
    public void Execute()
    {
        var storableTypeFinder = new TypeFinder(ModuleDefinition, AssemblyResolver, ISTORABLE);

        storableTypeFinder.Execute();

        var checkLoadedInjector = new MethodFinder(ModuleDefinition, CHECK_IS_LOADED, 0);

        var typeResolver = new TypeResolver();
        var implementsInterfaceFinder = new ImplementsInterfaceFinder(typeResolver);

        var classes = ModuleDefinition.GetTypes()
                      .Where(x => x.IsClass)
                      .ToList();

        foreach (var type in classes)
        {
            var baseType = implementsInterfaceFinder.HierarchyImplementsIStorable(type);
            if (baseType == null)
            {
                continue;
            }
            var checkMethod = checkLoadedInjector.Execute(baseType);
            ProcessType(type, checkMethod);
        }
    }
Ejemplo n.º 3
0
    public void Execute()
    {
        var freezableTypeFinder = new FreezableTypeFinder(ModuleDefinition, AssemblyResolver);
        freezableTypeFinder.Execute();

        var exceptionFinder = new ExceptionFinder(ModuleDefinition, AssemblyResolver);
        exceptionFinder.Execute();

        var volatileFinder = new VolatileTypeFinder(ModuleDefinition, AssemblyResolver);
        volatileFinder.Execute();

        var volatileFieldFixer = new VolatileFieldFixer(volatileFinder);
        var fieldInjector = new FieldInjector(volatileFinder, ModuleDefinition.TypeSystem, volatileFieldFixer);
        var checkIsFrozenBuilder = new CheckIsFrozenBuilder(ModuleDefinition.TypeSystem, exceptionFinder);
        var freezeCheckerInjector = new FreezeCheckerInjector(ModuleDefinition, fieldInjector, checkIsFrozenBuilder);

        var typeResolver = new TypeResolver();
        var implementsInterfaceFinder = new ImplementsInterfaceFinder(typeResolver);

        var classes = ModuleDefinition.GetTypes()
            .Where(x => x.IsClass)
            .ToList();
        var assemblyProcessor = new AssemblyProcessor(freezeCheckerInjector, implementsInterfaceFinder, LogInfo);
        assemblyProcessor.Execute(classes);

        volatileFieldFixer.Execute(classes);
    }
Ejemplo n.º 4
0
 public AssemblyProcessor(FreezeCheckerInjector freezeCheckerInjector, ImplementsInterfaceFinder implementsInterfaceFinder, Action <string> logInfo)
 {
     this.freezeCheckerInjector     = freezeCheckerInjector;
     this.implementsInterfaceFinder = implementsInterfaceFinder;
     this.logInfo = logInfo;
 }
Ejemplo n.º 5
0
 public AssemblyProcessor(MethodInjector loadedCheckerInjector, ImplementsInterfaceFinder implementsInterfaceFinder, Action <string> logInfo)
 {
     this.loadedCheckerInjector     = loadedCheckerInjector;
     this.implementsInterfaceFinder = implementsInterfaceFinder;
     this.logInfo = logInfo;
 }
Ejemplo n.º 6
0
 public AssemblyProcessor(FreezeCheckerInjector freezeCheckerInjector, ImplementsInterfaceFinder implementsInterfaceFinder, Action<string> logInfo)
 {
     this.freezeCheckerInjector = freezeCheckerInjector;
     this.implementsInterfaceFinder = implementsInterfaceFinder;
     this.logInfo = logInfo;
 }