/// <summary>
 /// Apply the given parameters values to all templates in this collection and generate text from
 /// each template based on the given parameters. This should be used if all templates use common
 /// or similar set of parameters
 /// </summary>
 /// <param name="composer"></param>
 /// <param name="paramsValues"></param>
 /// <returns></returns>
 public static Dictionary <string, string> GenerateText(this ParametricTextComposerCollection composer, params object[] paramsValues)
 {
     return
         (composer
          .ToDictionary(
              pair => pair.Key,
              pair => pair.Value.GenerateText(paramsValues)
              ));
 }
        /// <summary>
        /// Create a new ParametricTextBuilderCollection object and add some templates from this object
        /// (by reference) to the new object
        /// </summary>
        /// <param name="templatesNames"></param>
        /// <returns></returns>
        public ParametricTextComposerCollection SubCollection(IEnumerable <string> templatesNames)
        {
            var subCollection = new ParametricTextComposerCollection
            {
                _alignMultiLineParameterValues = _ignoreUndefinedParameters,
                _ignoreUndefinedParameters     = _ignoreUndefinedParameters
            };

            foreach (var templateName in templatesNames)
            {
                if (
                    ComposersDictionary.TryGetValue(templateName, out var template) &&
                    subCollection.ComposersDictionary.ContainsKey(templateName) == false
                    )
                {
                    subCollection.ComposersDictionary.Add(templateName, template);
                }
            }

            return(subCollection);
        }