public MethodInjector(InterceptorFinder interceptorFinder, DelegateHolderInjector delegateHolderInjector, MsCoreReferenceFinder msCoreReferenceFinder, EventInvokerNameResolver eventInvokerNameResolver)
 {
     this.interceptorFinder = interceptorFinder;
     this.delegateHolderInjector = delegateHolderInjector;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.eventInvokerNameResolver = eventInvokerNameResolver;
 }
        public ExposedPropertiesWeaver(CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
        {
            ViewModelToModelAttributeTypeDefinition = FodyEnvironment.ModuleDefinition.FindType("Catel.MVVM", "Catel.MVVM.ViewModelToModelAttribute") as TypeDefinition;

            _catelTypeNodeBuilder = catelTypeNodeBuilder;
            _msCoreReferenceFinder = msCoreReferenceFinder;
        }
Esempio n. 3
0
        public ArgumentWeaver(TypeDefinition typeDefinition, MsCoreReferenceFinder msCoreReferenceFinder)
        {
            EnsureCache();

            _typeDefinition        = typeDefinition;
            _msCoreReferenceFinder = msCoreReferenceFinder;
        }
Esempio n. 4
0
 public FieldToPropertyForwarder(ModuleWeaver moduleWeaver, FieldToPropertyConverter fieldToPropertyConverter, MsCoreReferenceFinder msCoreReferenceFinder, MethodFinder methodFinder)
 {
     this.moduleWeaver          = moduleWeaver;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.methodFinder          = methodFinder;
     forwardedFields            = fieldToPropertyConverter.ForwardedFields;
 }
Esempio n. 5
0
 public FieldToPropertyForwarder(ModuleWeaver moduleWeaver, FieldToPropertyConverter fieldToPropertyConverter, MsCoreReferenceFinder msCoreReferenceFinder, MethodFinder methodFinder)
 {
     this.moduleWeaver = moduleWeaver;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.methodFinder = methodFinder;
     forwardedFields = fieldToPropertyConverter.ForwardedFields;
 }
 public PropertyWeaver(MsCoreReferenceFinder msCoreReferenceFinder, Logger logger, PropertyData propertyData, TypeNode typeNode)
 {
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.logger       = logger;
     this.propertyData = propertyData;
     this.typeNode     = typeNode;
 }
Esempio n. 7
0
 public ArgumentWeaverService(List <TypeDefinition> allTypes, MsCoreReferenceFinder msCoreReferenceFinder,
                              Configuration configuration)
 {
     _allTypes = allTypes;
     _msCoreReferenceFinder = msCoreReferenceFinder;
     _configuration         = configuration;
 }
Esempio n. 8
0
        public ArgumentWeaver(TypeDefinition typeDefinition, MsCoreReferenceFinder msCoreReferenceFinder)
        {
            EnsureCache();

            _typeDefinition = typeDefinition;
            _msCoreReferenceFinder = msCoreReferenceFinder;
        }
Esempio n. 9
0
    public void Execute()
    {
        msCoreReferenceFinder = new MsCoreReferenceFinder
        {
            AssemblyResolver = ModuleDefinition.AssemblyResolver,
        };
        msCoreReferenceFinder.Execute();
        var comparisonFinder = new DefaultStringComparisonFinder
        {
            ModuleWeaver          = this,
            MsCoreReferenceFinder = msCoreReferenceFinder,
        };

        comparisonFinder.Execute();
        converterCache = new ConverterCache
        {
            MsCoreReferenceFinder         = msCoreReferenceFinder,
            ModuleDefinition              = ModuleDefinition,
            DefaultStringComparisonFinder = comparisonFinder
        };
        converterCache.Execute();

        foreach (var type in ModuleDefinition.GetTypes())
        {
            if (type.IsInterface)
            {
                continue;
            }
            if (type.IsEnum)
            {
                continue;
            }
            ProcessType(type);
        }
    }
 public FieldToPropertyConverter(TypeNodeBuilder typeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder, Logger logger)
 {
     ForwardedFields = new Dictionary<FieldDefinition, PropertyDefinition>();
     this.typeNodeBuilder = typeNodeBuilder;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.logger = logger;
 }
 public FieldToPropertyConverter(TypeNodeBuilder typeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder, Logger logger)
 {
     ForwardedFields            = new Dictionary <FieldDefinition, PropertyDefinition>();
     this.typeNodeBuilder       = typeNodeBuilder;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.logger = logger;
 }
 public PropertyWeaver(MsCoreReferenceFinder msCoreReferenceFinder, Logger logger, PropertyData propertyData, TypeNode typeNode)
 {
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.logger = logger;
     this.propertyData = propertyData;
     this.typeNode = typeNode;
 }
Esempio n. 13
0
        public void ImportModuleLoader(ModuleDefinition moduleDefinition, MethodReference methodToCall,
                                       MsCoreReferenceFinder msCoreReferenceFinder)
        {
            const MethodAttributes attributes = MethodAttributes.Private
                                                | MethodAttributes.HideBySig
                                                | MethodAttributes.Static
                                                | MethodAttributes.SpecialName
                                                | MethodAttributes.RTSpecialName;

            var moduleClass = moduleDefinition.Types.FirstOrDefault(x => x.Name == "<Module>");

            if (moduleClass is null)
            {
                throw new WeavingException("Found no module class!");
            }

            var cctor = moduleClass.Methods.FirstOrDefault(x => x.Name == ".cctor");

            if (cctor is null)
            {
                cctor = new MethodDefinition(".cctor", attributes, moduleDefinition.ImportReference(msCoreReferenceFinder.GetCoreTypeReference("Void")));
                cctor.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
                moduleClass.Methods.Add(cctor);
            }

            var importedMethodToCall = moduleDefinition.ImportReference(methodToCall);

            var insertLocation = Math.Max(cctor.Body.Instructions.Count - 2, 0);

            cctor.Body.Instructions.Insert(insertLocation, Instruction.Create(OpCodes.Call, importedMethodToCall));
        }
 public TypeProcessor(TypeNodeBuilder typeNodeBuilder, Logger logger, MsCoreReferenceFinder msCoreReferenceFinder, TypeEqualityFinder typeEqualityFinder)
 {
     this.typeNodeBuilder = typeNodeBuilder;
     this.logger = logger;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeEqualityFinder = typeEqualityFinder;
 }
Esempio n. 15
0
        public ExposedPropertiesWeaver(CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
        {
            ViewModelToModelAttributeTypeDefinition = FodyEnvironment.ModuleDefinition.FindType("Catel.MVVM", "Catel.MVVM.ViewModelToModelAttribute") as TypeDefinition;

            _catelTypeNodeBuilder  = catelTypeNodeBuilder;
            _msCoreReferenceFinder = msCoreReferenceFinder;
        }
Esempio n. 16
0
    public void Execute()
    {
        msCoreReferenceFinder = new MsCoreReferenceFinder
                                        {
                                            AssemblyResolver = ModuleDefinition.AssemblyResolver,
                                        };
        msCoreReferenceFinder.Execute();
        var comparisonFinder = new DefaultStringComparisonFinder
                                   {
                                       ModuleWeaver = this,
                                       MsCoreReferenceFinder = msCoreReferenceFinder,
                                   };
        comparisonFinder.Execute();
        converterCache = new ConverterCache
                             {
                                 MsCoreReferenceFinder = msCoreReferenceFinder,
                                 ModuleDefinition = ModuleDefinition,
                                 DefaultStringComparisonFinder = comparisonFinder
                             };
        converterCache.Execute();

        foreach (var type in ModuleDefinition.GetTypes())
        {
            if (type.IsInterface)
            {
                continue;
            }
            if (type.IsEnum)
            {
                continue;
            }
            ProcessType(type);
        }
    }
 public MethodInjector(InterceptorFinder interceptorFinder, DelegateHolderInjector delegateHolderInjector, MsCoreReferenceFinder msCoreReferenceFinder, EventInvokerNameResolver eventInvokerNameResolver)
 {
     this.interceptorFinder        = interceptorFinder;
     this.delegateHolderInjector   = delegateHolderInjector;
     this.msCoreReferenceFinder    = msCoreReferenceFinder;
     this.eventInvokerNameResolver = eventInvokerNameResolver;
 }
 public TypeProcessor(TypeNodeBuilder typeNodeBuilder, Logger logger, MsCoreReferenceFinder msCoreReferenceFinder, TypeEqualityFinder typeEqualityFinder)
 {
     this.typeNodeBuilder       = typeNodeBuilder;
     this.logger                = logger;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeEqualityFinder    = typeEqualityFinder;
 }
Esempio n. 19
0
    public TypeEqualityFinder(ModuleReader moduleReader, MsCoreReferenceFinder msCoreReferenceFinder, TypeResolver typeResolver)
    {
        methodCache = new Dictionary <string, MethodReference>();

        this.moduleReader          = moduleReader;
        this.msCoreReferenceFinder = msCoreReferenceFinder;
        this.typeResolver          = typeResolver;
    }
Esempio n. 20
0
 public FieldToPropertyConverter(ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder,
                                 TypeSystem typeSystem, List<TypeDefinition> allTypes)
 {
     this.moduleWeaver = moduleWeaver;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeSystem = typeSystem;
     this.allTypes = allTypes;
 }
 public FieldToPropertyConverter(ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder,
                                 TypeSystem typeSystem, List <TypeDefinition> allTypes)
 {
     this.moduleWeaver          = moduleWeaver;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeSystem            = typeSystem;
     this.allTypes = allTypes;
 }
 public AutoPropertiesWeaver(Configuration configuration, ModuleWeaver moduleWeaver,
                             CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _configuration         = configuration;
     _moduleWeaver          = moduleWeaver;
     _catelTypeNodeBuilder  = catelTypeNodeBuilder;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
 public ImplementITrackableInjector(ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder,
                                    TypeSystem typeSystem, List <TypeDefinition> allPocoTypes)
 {
     this.moduleWeaver          = moduleWeaver;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeSystem            = typeSystem;
     this._allPocoTypes         = allPocoTypes;
 }
Esempio n. 24
0
 public ExposedPropertiesWeaverService(ModuleWeaver moduleWeaver, Configuration configuration, CatelTypeNodeBuilder catelTypeNodeBuilder,
                                       MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _moduleWeaver          = moduleWeaver;
     _configuration         = configuration;
     _catelTypeNodeBuilder  = catelTypeNodeBuilder;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
    public TypeEqualityFinder(ModuleReader moduleReader, MsCoreReferenceFinder msCoreReferenceFinder, TypeResolver typeResolver)
    {
        methodCache = new Dictionary<string, MethodReference>();

        this.moduleReader = moduleReader;
        this.msCoreReferenceFinder = msCoreReferenceFinder;
        this.typeResolver = typeResolver;
    }
 public LoadTypesWeaver(ModuleDefinition moduleDefinition, MsCoreReferenceFinder msCoreReferenceFinder,
                        Configuration configuration, ModuleWeaver moduleWeaver)
 {
     _moduleDefinition      = moduleDefinition;
     _msCoreReferenceFinder = msCoreReferenceFinder;
     _configuration         = configuration;
     _moduleWeaver          = moduleWeaver;
 }
Esempio n. 27
0
        public ArgumentWeaver(TypeDefinition typeDefinition, MsCoreReferenceFinder msCoreReferenceFinder,
                              Configuration configuration)
        {
            EnsureCache();

            _typeDefinition        = typeDefinition;
            _msCoreReferenceFinder = msCoreReferenceFinder;
            _configuration         = configuration;
        }
 public IsChangedMethodFinder(MethodGenerifier methodGenerifier, Logger logger, MsCoreReferenceFinder msCoreReferenceFinder, TypeNodeBuilder typeNodeBuilder, ModuleReader moduleReader, TypeResolver typeResolver)
 {
     this.methodGenerifier      = methodGenerifier;
     this.logger                = logger;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeNodeBuilder       = typeNodeBuilder;
     this.moduleReader          = moduleReader;
     this.typeResolver          = typeResolver;
 }
 public IsChangedMethodFinder(MethodGenerifier methodGenerifier, Logger logger, MsCoreReferenceFinder msCoreReferenceFinder, TypeNodeBuilder typeNodeBuilder, ModuleReader moduleReader, TypeResolver typeResolver)
 {
     this.methodGenerifier = methodGenerifier;
     this.logger = logger;
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.typeNodeBuilder = typeNodeBuilder;
     this.moduleReader = moduleReader;
     this.typeResolver = typeResolver;
 }
Esempio n. 30
0
    public void Execute()
    {
        var msCoreReferenceFinder = new MsCoreReferenceFinder(this, ModuleDefinition.AssemblyResolver);
        msCoreReferenceFinder.Execute();
        var allTypes = ModuleDefinition.GetTypes().ToList();

        var fieldToPropertyFinder = new MethodFinder(allTypes);
        fieldToPropertyFinder.Execute();
        var fieldToPropertyConverter = new FieldToPropertyConverter(this, msCoreReferenceFinder, ModuleDefinition.TypeSystem, allTypes);
        fieldToPropertyConverter.Execute();
        var fieldToPropertyForwarder = new FieldToPropertyForwarder(this, fieldToPropertyConverter, msCoreReferenceFinder, fieldToPropertyFinder);
        fieldToPropertyForwarder.Execute();
    }
Esempio n. 31
0
    public override void Execute()
    {
        var msCoreReferenceFinder = new MsCoreReferenceFinder(this, ModuleDefinition.AssemblyResolver);

        msCoreReferenceFinder.Execute();

        var allPocoTypes = ModuleDefinition.GetTypes().ToList();
        var finder       = new MethodFinder(allPocoTypes);

        finder.Execute();
        var converter = new ImplementITrackableInjector(this, msCoreReferenceFinder, ModuleDefinition.TypeSystem, allPocoTypes);

        converter.Execute();
    }
Esempio n. 32
0
    public void Execute()
    {
        var msCoreReferenceFinder = new MsCoreReferenceFinder(this, ModuleDefinition.AssemblyResolver);

        msCoreReferenceFinder.Execute();
        var allTypes = ModuleDefinition.GetTypes().ToList();

        var fieldToPropertyFinder = new MethodFinder(allTypes);

        fieldToPropertyFinder.Execute();
        var fieldToPropertyConverter = new FieldToPropertyConverter(this, msCoreReferenceFinder, ModuleDefinition.TypeSystem, allTypes);

        fieldToPropertyConverter.Execute();
        var fieldToPropertyForwarder = new FieldToPropertyForwarder(this, fieldToPropertyConverter, msCoreReferenceFinder, fieldToPropertyFinder);

        fieldToPropertyForwarder.Execute();
    }
 public DelegateHolderInjector(MsCoreReferenceFinder msCoreReferenceFinder)
 {
     this.msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 34
0
 public AutoPropertiesWeaver(Configuration configuration, CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _configuration = configuration;
     _catelTypeNodeBuilder = catelTypeNodeBuilder;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 35
0
 public XmlSchemasWeaver(MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
 public ExposedPropertiesWeaverService(CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelTypeNodeBuilder = catelTypeNodeBuilder;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 37
0
 public OnPropertyChangedWeaver(CatelType catelType, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType = catelType;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
 public ExposedPropertiesWeaverService(CatelTypeNodeBuilder catelTypeNodeBuilder, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelTypeNodeBuilder  = catelTypeNodeBuilder;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 39
0
 public XmlSchemasWeaverService(MsCoreReferenceFinder msCoreReferenceFinder, CatelTypeNodeBuilder catelTypeNodeBuilder)
 {
     _msCoreReferenceFinder = msCoreReferenceFinder;
     _catelTypeNodeBuilder = catelTypeNodeBuilder;
 }
Esempio n. 40
0
 public XmlSchemasWeaver(ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _moduleWeaver          = moduleWeaver;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 41
0
 public XmlSchemasWeaverService(ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder, CatelTypeNodeBuilder catelTypeNodeBuilder)
 {
     _moduleWeaver          = moduleWeaver;
     _msCoreReferenceFinder = msCoreReferenceFinder;
     _catelTypeNodeBuilder  = catelTypeNodeBuilder;
 }
 public OnPropertyChangedWeaver(CatelType catelType, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType             = catelType;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 43
0
 public ArgumentWeaverService(List<TypeDefinition> allTypes, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _allTypes = allTypes;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Esempio n. 44
0
 public ArgumentWeaverService(List <TypeDefinition> allTypes, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _allTypes = allTypes;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
 public DelegateHolderInjector(MsCoreReferenceFinder msCoreReferenceFinder)
 {
     this.msCoreReferenceFinder = msCoreReferenceFinder;
 }
 public ModuleLoaderImporter(ModuleReader moduleReader, AssemblyLoaderImporter assemblyLoaderImporter, MsCoreReferenceFinder coreReferenceFinder)
 {
     this.moduleReader           = moduleReader;
     this.assemblyLoaderImporter = assemblyLoaderImporter;
     this.coreReferenceFinder    = coreReferenceFinder;
 }
Esempio n. 47
0
 public ModuleLoaderImporter(ModuleReader moduleReader, AssemblyLoaderImporter assemblyLoaderImporter, MsCoreReferenceFinder coreReferenceFinder)
 {
     this.moduleReader = moduleReader;
     this.assemblyLoaderImporter = assemblyLoaderImporter;
     this.coreReferenceFinder = coreReferenceFinder;
 }
Esempio n. 48
0
    public void Execute()
    {
        var msCoreReferenceFinder = new MsCoreReferenceFinder(this, ModuleDefinition.AssemblyResolver);
        msCoreReferenceFinder.Execute();

        var allTypes = ModuleDefinition.GetTypes()
                        .Where(t => t.Interfaces
                                        .Any(itr=>itr.Name==IFACEName))
                        .ToList();

        var fieldToPropertyConverter = new FieldToPropertyConverter(this, msCoreReferenceFinder, ModuleDefinition.TypeSystem, allTypes,ModuleDefinition);
        fieldToPropertyConverter.Execute();
    }
Esempio n. 49
0
 public XmlSchemasWeaver(MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }