public List <MethodInfo> GetMethods(Type annotationType) { Func <MethodInfo, bool> methodFilter = info => info.GetCustomAttributes() .Any(a => a.GetType().FullName.Equals(annotationType.FullName)); Func <Type, IEnumerable <MethodInfo> > methodSelector = t => t.GetMethods().Where(methodFilter); return(AssembliesReferencingGaugeLib.SelectMany(assembly => assembly.GetTypes().SelectMany(methodSelector)).ToList()); }
public List <MethodInfo> GetMethods(Type annotationType) { var typeFromTargetLib = GetTypeFromTargetLib(annotationType); Func <MethodInfo, bool> methodFilter = info => info.GetCustomAttributes(typeFromTargetLib).Any(); Func <Type, IEnumerable <MethodInfo> > methodSelector = t => t.GetMethods().Where(methodFilter); return(AssembliesReferencingGaugeLib.SelectMany(assembly => assembly.GetTypes().SelectMany(methodSelector)).ToList()); }
public IEnumerable <MethodInfo> GetMethods(LibType type) { var attributeType = _targetLibAssembly.GetType(type.FullName()); bool methodFilter(MethodInfo info) => info.GetCustomAttributes(false) .Any(attributeType.IsInstanceOfType); IEnumerable <MethodInfo> methodSelector(Type t) => _reflectionWrapper.GetMethods(t).Where(methodFilter); return(AssembliesReferencingGaugeLib.SelectMany(assembly => assembly.GetTypes().SelectMany(methodSelector))); }
public IEnumerable <MethodInfo> GetMethods(LibType type) { var attributeType = _targetLibAssembly.ExportedTypes.First(x => x.FullName == type.FullName()); IEnumerable <MethodInfo> MethodSelector(Type t) { return(_reflectionWrapper.GetMethods(t) .Where(info => info.GetCustomAttributes(false).Any(attributeType.IsInstanceOfType))); } return(AssembliesReferencingGaugeLib.SelectMany(assembly => assembly.ExportedTypes.SelectMany(MethodSelector))); }