Пример #1
0
    /// <summary>
    /// Called when the weaver is executed.
    /// </summary>
    public override void Execute()
    {
        GlobalModule = ModuleDefinition;
        Log = LogInfo;

        Context = new WeaveContext(ModuleDefinition);
        Context.Finder = new ReferenceFinder(ModuleDefinition);
        Context.Candidates = new WeaveCandidates(ModuleDefinition, Context.Finder);
        GlobalContext = Context;

        InitializeStaticContainer();

        WeaveImplementations();
        WeaveMethodInterceptors();
        WeavePropertyInterceptors();
        WeaveFieldInterceptors();
        WeaveConstructorInterceptors();
    }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TypeEmitter" /> class.
 /// </summary>
 /// <param name="module">The module.</param>
 /// <param name="type">The type.</param>
 /// <param name="context">The context.</param>
 public TypeEmitter(ModuleDefinition module, TypeReference type, WeaveContext context)
 {
     Context = context;
     Module  = module;
     Target  = type as TypeDefinition ?? type.Resolve();
 }