示例#1
0
            public override void Patch(MethodDefinition source)
            {
                ILProcessor il      = source.Body.GetILProcessor();
                Instruction oldSet  = il.GetStsfldInstruction(FontFieldName);
                Instruction newCall = il.CreateCallInstruction(TargetMethod);

                il.InsertBefore(oldSet, newCall);
            }
示例#2
0
            public override void Patch(MethodDefinition source)
            {
                ILProcessor il = source.Body.GetILProcessor();

                il.ClearInstructions();
                il.ClearVariables();
                il.Append(il.CreateCallInstruction(TargetMethod));
                il.Emit(OpCodes.Ret);
            }
示例#3
0
            public override void Patch(MethodDefinition source)
            {
                FieldDefinition fieldText = source.DeclaringType.GetField(LogoSpriteFieldName);

                ILProcessor il     = source.Body.GetILProcessor();
                Instruction target = il.GetFirstInstruction();

                il.InsertBefore(target, Instruction.Create(OpCodes.Ldarg_0));
                il.InsertBefore(target, Instruction.Create(OpCodes.Ldflda, fieldText));
                il.InsertBefore(target, il.CreateCallInstruction(TargetMethod));
            }