private static IEnumerable<ParameterTypeMatchingInfo> ConvertFromConfigToRuntimeInfo(
     ParameterTypeMatchingRuleData ruleData)
 {
     foreach (ParameterTypeMatchData matchData in ruleData.Matches)
     {
         yield return
             new ParameterTypeMatchingInfo(matchData.Match, matchData.IgnoreCase, matchData.ParameterKind);
     }
 }
 private static IEnumerable <ParameterTypeMatchingInfo> ConvertFromConfigToRuntimeInfo(
     ParameterTypeMatchingRuleData ruleData)
 {
     foreach (ParameterTypeMatchData matchData in ruleData.Matches)
     {
         yield return
             (new ParameterTypeMatchingInfo(matchData.Match, matchData.IgnoreCase, matchData.ParameterKind));
     }
 }
Example #3
0
        /// <summary>
        /// Builds an instance of the subtype of IMatchingRule type the receiver knows how to build, based on
        /// a configuration object.
        /// </summary>
        /// <param name="context">The <see cref="IBuilderContext"/> that represents the current building process.</param>
        /// <param name="objectConfiguration">The configuration object that describes the object to build.</param>
        /// <param name="configurationSource">The source for configuration objects.</param>
        /// <param name="reflectionCache">The cache to use retrieving reflection information.</param>
        /// <returns>A fully initialized instance of the IMatchingRule subtype.</returns>
        public IMatchingRule Assemble(IBuilderContext context, MatchingRuleData objectConfiguration,
                                      IConfigurationSource configurationSource,
                                      ConfigurationReflectionCache reflectionCache)
        {
            ParameterTypeMatchingRuleData ruleData     = (ParameterTypeMatchingRuleData)objectConfiguration;
            ParameterTypeMatchingRule     matchingRule =
                new ParameterTypeMatchingRule(ConvertFromConfigToRuntimeInfo(ruleData));

            return(matchingRule);
        }