/// <summary> /// Generate the given template text from the supplied parameters values and add its output to /// the given text builder /// </summary> /// <param name="textBuilder"></param> /// <param name="template"></param> /// <param name="paramsValues"></param> public static void Add(this ListComposer textBuilder, ParametricComposer template, IParametericComposerValueSource paramsValues) { template.SetParametersValues(paramsValues); var text = template.GenerateText(); textBuilder.Add(text); }
/// <summary> /// Generate the given template text from the supplied parameters values and add its output to /// the given text builder at the given index /// </summary> /// <param name="textBuilder"></param> /// <param name="index"></param> /// <param name="template"></param> /// <param name="paramsValues"></param> public static void Insert(this ListComposer textBuilder, int index, ParametricComposer template, IParametericComposerValueSource paramsValues) { template.SetParametersValues(paramsValues); var text = template.GenerateText(); textBuilder.Insert(index, new StructuredTextItem(text)); }
/// <summary> /// Generate the given template text from the supplied parameters values and add its output to /// the given text builder /// </summary> /// <param name="textBuilder"></param> /// <param name="template"></param> /// <param name="paramsValues"></param> public static void Add(this ListComposer textBuilder, ParametricComposer template, IDictionary <string, string> paramsValues) { template.SetParametersValues(paramsValues); var text = template.GenerateText(); textBuilder.Add(text); }
/// <summary> /// Create and initialize a list composer from the given inputs /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> /// <param name="separator"></param> /// <returns></returns> public static ListComposer ComposeToList <T>(this IEnumerable <T> items, string separator) { var composer = new ListComposer() { Separator = separator }; return(composer.AddRange(items)); }
/// <summary> /// Create and initialize a list composer from the given inputs /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> /// <param name="separator"></param> /// <param name="finalPrefix"></param> /// <param name="finalSuffix"></param> /// <returns></returns> public static ListComposer ComposeToList <T>(this IEnumerable <T> items, string separator, string finalPrefix, string finalSuffix) { var composer = new ListComposer() { Separator = separator, FinalPrefix = finalPrefix, FinalSuffix = finalSuffix }; return(composer.AddRange(items)); }
/// <summary> /// Create and initialize a list composer from the given inputs /// </summary> /// <typeparam name="T"></typeparam> /// <param name="items"></param> /// <returns></returns> public static ListComposer ComposeToList <T>(this IEnumerable <T> items) { var composer = new ListComposer(); return(composer.AddRange(items)); }
/// <summary> /// Create and initialize a list composer from the given inputs /// </summary> /// <param name="items"></param> /// <returns></returns> public static ListComposer ComposeToList(this IEnumerable <StructuredTextItem> items) { var composer = new ListComposer(); return(composer.AddRange(items)); }