Beispiel #1
0
 internal static StringBuilderIndented InterfaceInit(this StringBuilderIndented builder, string interfaceName, string parent, string nameSpace, ClassVisility visibily, bool partial, params string[] usings)
 {
     return(builder
            .AddUsing(usings)
            .AppendLine()
            .AppendLine($"namespace {nameSpace}")
            .AppendLine("{")
            .IncrementIndent()
            .Append(visibily.ToString().ToLower())
            .Append(" interface ")
            .Append(interfaceName)
            .Append(parent.IsNotEmpty() ? $": {parent}" : string.Empty)
            .AppendLine()
            .AppendLine("{")
            .IncrementIndent());
 }
 internal static StringBuilderIndented ClassInit(this StringBuilderIndented builder, string className, string parent, string nameSpace, ClassVisibility visibility, bool partial, params string[] usings)
 {
     return(builder
            .AddUsing(usings)
            .AppendLine()
            .AppendLine($"namespace {nameSpace}")
            .AppendLine("{")
            .IncrementIndent()
            .Append(VisibilityParse(visibility))
            .Append(partial ? " partial" : string.Empty)
            .Append(" class ")
            .Append(className)
            .Append(parent.IsNotEmpty() ? $": {parent}" : string.Empty)
            .AppendLine()
            .AppendLine("{")
            .IncrementIndent());
 }