Weave() public method

public Weave ( ILGenerator ilGenerator ) : void
ilGenerator System.Reflection.Emit.ILGenerator
return void
Exemplo n.º 1
0
        public virtual void Weave(ILGenerator ilGenerator)
        {
            MethodScopeWeaversQueue methodScopeWeaversQueue = null;

            weavers.Add(new BeginExceptionBlockMethodScopeWeaver());
            weavers.AddRange(tryWeavers);
            weavers.Add(new FinallyMethodScopeWeaver(finallyWeavers));
            weavers.Add(new EndExceptionBlockMethodScopeWeaver());

            if (returnValueWeaver.IsNotNull()) {
                weavers.Add(returnValueWeaver);
            }

            methodScopeWeaversQueue = new MethodScopeWeaversQueue(weavers);
            methodScopeWeaversQueue.Weave(ilGenerator);
        }
Exemplo n.º 2
0
        public override void Weave(ILGenerator ilGenerator)
        {
            var weavers = new List<IMethodScopeWeaver>();
            MethodScopeWeaversQueue methodScopeWeaversQueue = null;

            weavers.AddRange(entryWeavers);
            weavers.Add(new BeginExceptionBlockMethodScopeWeaver());
            weavers.Add(new BeginExceptionBlockMethodScopeWeaver());
            weavers.AddRange(tryWeavers);
            weavers.Add(new BeginCatchBlockMethodScopeWeaver(catchWeavers, tryCatchFinallySettings));
            weavers.Add(new EndExceptionBlockMethodScopeWeaver());
            weavers.Add(new FinallyMethodScopeWeaver(finallyWeavers));
            weavers.Add(new EndExceptionBlockMethodScopeWeaver());

            if (returnValueWeaver.IsNotNull()) {
                weavers.Add(returnValueWeaver);
            }

            methodScopeWeaversQueue = new MethodScopeWeaversQueue(weavers);
            methodScopeWeaversQueue.Weave(ilGenerator);
        }