private void OverrideEventMethod(MethodInfo method, int count) { if (method != null && MethodOverride.MethodCanBeIntercepted(method)) { new MethodOverride(_typeBuilder, _proxyInterceptionPipelineField, method, _targetType, _mainTypeMapper, count).AddMethod(); } }
private IEnumerable<MethodInfo> GetMethodsToIntercept() { List<MethodInfo> methodsToIntercept = new List<MethodInfo>(); foreach (MethodInfo method in _typeToIntercept.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { if (!method.IsSpecialName && MethodOverride.MethodCanBeIntercepted(method)) { methodsToIntercept.Add(method); } } MethodSorter sorter = new MethodSorter(_typeToIntercept, methodsToIntercept); foreach (MethodInfo method in sorter) { yield return method; } }