protected override string OnCodeTail() { return(@" /// <summary> /// Loads the configuration section. /// </summary> /// <returns>The configuration section for " + Name + @".</returns> public static " + Name.CapitalizeFirstLetter() + Type + @" Load() { object section = ConfigurationManager.GetSection(""" + Name + @"Group/" + Name + @"""); return (" + Name.CapitalizeFirstLetter() + Type + @")section; }" + Environment.NewLine + Environment.NewLine); }
/// <summary> /// Generate class as string /// </summary> public virtual string Generate() { var script = @"namespace " + Namespace + @".Configuration { using System; using System.Configuration; /// <summary> /// Represents the configuration for list. /// </summary> public class " + Name.CapitalizeFirstLetter() + Type + @" : " + GetInheritanceType() + @" { " + Environment.NewLine + PropertyKeys + Environment.NewLine + Properties + OnCodeTail() + @" } }"; return(script); }