コード例 #1
0
        public ILGenerator Weave(ILGenerator ilGenerator)
        {
            ilGenerator.BeginFinallyBlock();
            finallyWeaversQueue.Weave(ilGenerator);

            return(ilGenerator);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
0
 public void Weave(ILGenerator ilGenerator)
 {
     ilGenerator.BeginFinallyBlock();
     finallyWeaversQueue.Weave(ilGenerator);
 }