public static IEnumerable <ReferencePoint> Parse(IFuzzyFunction function) { return(function.GetType() .GetProperties() .Where(property => property.GetCustomAttributes(typeof(ReferencePointAttribute)).Any()) .Select(property => new ReferencePoint(property.Name))); }
public static IEnumerable <InRangePoint> Parse(IFuzzyFunction function) { return(function.GetType() .GetProperties() .Where(property => property.GetCustomAttributes(typeof(InRangePointAttribute)).Any()) .Select(property => new KeyValuePair <string, InRangePointAttribute>(property.Name, property.GetCustomAttribute <InRangePointAttribute>())) .Select(attribute => new InRangePoint(attribute.Key, attribute.Value.LeftPoint, attribute.Value.RightPoint))); }