예제 #1
0
        public void DecorateMethod(MethodDefinition method, FieldDefinition interceptorManager)
        {
            string newMethodName = string.Format(CultureInfo.InvariantCulture, "{0}<SP>", method.Name);
            MethodDefinition implementationMethod = method.CreateCopy(newMethodName);

            method.DeclaringType.Methods.Add(implementationMethod);

            DeleteMethodImplementation(method);

            this.WeaveInterceptionCall(method, method, implementationMethod, interceptorManager);
        }