public Method GetMethod(string className, string methodName, Frameworks framework, out Class @class, int overload) { @class = GetClass(className); if (@class == null) return null; if (overload < 0) return null; IEnumerable<Method> methodFinder = @class.Methods .Where(x => methodName.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase)); if (framework == Frameworks.NotSet) { methodFinder = methodFinder.OrderByDescending(x => x.Frameworks); } else { methodFinder = methodFinder.Where(x => x.Frameworks.HasFlag(framework)); } if( overload > 0 ) methodFinder = methodFinder.Skip(overload); return methodFinder.FirstOrDefault(); }
public Property GetProperty(string className, string propertyName, Frameworks framework, out Class @class) { @class = GetClass(className); if (@class == null) return null; IEnumerable<Property> propertyFinder = @class.Properties .Where(x => propertyName.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase)); if (framework == Frameworks.NotSet) { propertyFinder = propertyFinder.OrderByDescending(x => x.Frameworks); } else { propertyFinder = propertyFinder.Where(x => x.Frameworks.HasFlag(framework)); } return propertyFinder.FirstOrDefault(); }