private static List <Unit> FindUnitsImpl(List <Unit> existingMatches, string unitName, DimensionDefinition dimension, bool ignoreCase,
                                                 Matcher <Unit> matcher, ListMatcher <Unit> listMatcher)
        {
            if (string.IsNullOrWhiteSpace(unitName))
            {
                throw new ArgumentException("unitName must be a string at least one character of non-whitespace");
            }
            List <Unit> allUnits = (dimension == null) ? AllUnits : dimension.Units;

            return(existingMatches
                   .Union(matcher(allUnits, unitName, u => u.Key, ignoreCase))
                   .Union(matcher(allUnits, unitName, u => u.Name, ignoreCase))
                   .Union(matcher(allUnits, unitName, u => u.Plural, ignoreCase))
                   .Union(matcher(allUnits, unitName, u => u.Symbol, ignoreCase))
                   .Union(listMatcher(allUnits, unitName, u => u.OtherNames, ignoreCase))
                   .Union(listMatcher(allUnits, unitName, u => u.OtherSymbols, ignoreCase))
                   .Where(UnitFilter)
                   .OrderByDescending(x => x, UnitComparer.Comparer).ToList());
        }
        protected void CompareRows(Tree <Cell> table, int rowsToSkip)
        {
            var matcher = new ListMatcher(Processor, MatchStrategy);

            matcher.MarkCell(myArray, table, rowsToSkip);
        }
Esempio n. 3
0
        protected void CompareRows(Parse theTableRows)
        {
            var matcher = new ListMatcher(Processor, MatchStrategy);

            matcher.MarkCell(myArray, theTableRows);
        }
 private static List <DimensionDefinition> FindDimensionsImpl(List <DimensionDefinition> existingMatches, string dimensionName, bool ignoreCase,
                                                              Matcher <DimensionDefinition> matcher, ListMatcher <DimensionDefinition> listMatcher)
 {
     if (string.IsNullOrWhiteSpace(dimensionName))
     {
         throw new ArgumentException("dimensionName must be a string at least one character of non-whitespace");
     }
     return(existingMatches
            .Union(matcher(Dimensions, dimensionName, u => u.Key, ignoreCase))
            .Union(matcher(Dimensions, dimensionName, u => u.Name, ignoreCase))
            .Union(matcher(Dimensions, dimensionName, u => u.Symbol, ignoreCase))
            .Union(listMatcher(Dimensions, dimensionName, u => u.OtherNames, ignoreCase))
            .Union(listMatcher(Dimensions, dimensionName, u => u.OtherSymbols, ignoreCase))
            .Where(DimensionFilter)
            .OrderByDescending(x => x, DimensionDefinitionComparer.Comparer).ToList());
 }