public static string GenerateFileHeader(ControllerDataModel data, string fileappend) { var sb = new StringBuilder(); sb.AppendLine($"/* KRUISPUNT: {data.Stad}"); sb.Append(' ', 14); sb.Append(data.Naam); if (!string.IsNullOrWhiteSpace(data.Nummer) && !string.Equals(data.Naam, data.Nummer)) { sb.Append($" ({data.Nummer})"); } sb.AppendLine(); sb.Append(' ', 14); sb.AppendLine(data.Straat1); sb.Append(' ', 14); sb.AppendLine(data.Straat2); sb.AppendLine(); sb.AppendLine($" BESTAND: {data.Naam}{fileappend}"); sb.AppendLine($" CCOL: {data.CCOLVersie.GetDescription()}"); sb.AppendLine($" TLCGEN: {data.TLCGenVersie}"); sb.AppendLine($" CCOLGEN: {CCOLCodeGeneratorPlugin.GetVersion()}"); sb.AppendLine("*/"); return(sb.ToString()); }
/// <summary> /// Generates a file header /// </summary> /// <param name="data">The ControllerDataModel instance that holds the info for generation</param> /// <param name="fileappend">The string to append to the Controller name to get the file name.</param> /// <returns>A string holding the file header</returns> private string GenerateFileHeader(ControllerDataModel data, string fileappend) { var sb = new StringBuilder(); sb.AppendLine($"/* KRUISPUNT: {data.Stad}"); sb.Append(' ', 14); sb.AppendLine(data.Naam); sb.Append(' ', 14); sb.AppendLine(data.Straat1); sb.Append(' ', 14); sb.AppendLine(data.Straat2); sb.AppendLine(); sb.AppendLine($" BESTAND: {data.Naam}{fileappend}"); sb.AppendLine($" CCOL: {data.CCOLVersie.GetDescription()}"); sb.AppendLine($" TLCGEN: {data.TLCGenVersie}"); sb.AppendLine($" CCOLGEN: {CCOLCodeGeneratorPlugin.GetVersion()}"); sb.AppendLine("*/"); return(sb.ToString()); }