예제 #1
0
 /// <summary>
 /// <paramref name="access"/>> enum <paramref name="enumName"/> [: <paramref name="baseName"/>]
 /// {
 /// </summary>
 /// <param name="access">Access modifiers</param>
 /// <param name="enumName">Name of the enum</param>
 /// <param name="baseName">optional base type name</param>
 public void StartEnum(AccessModifiers access, string enumName, string? baseName)
 {
     WriteIndent();
     _writer.Write($"{access.ToCode()} enum {enumName}");
     if (!String.IsNullOrEmpty(baseName))
         _writer.Write($" : {baseName}");
     _writer.WriteLine();
     WriteIndent();
     _writer.WriteLine("{");
     IncrementIndent();
 }
예제 #2
0
 /// <summary>
 /// <paramref name="access"/> <paramref name="modifiers"/> <paramref name="keyword"/> <paramref name="className"/> [: <paramref name="baseNames"/>]
 /// {
 /// </summary>
 /// <param name="access">Access modifiers</param>
 /// <param name="modifiers">class modifiers</param>
 /// <param name="keyword">class, record or struct</param>
 /// <param name="className">Class name</param>
 /// <param name="baseNames">Base class and/or interface names.</param>
 public void StartClass(AccessModifiers access, ClassModifiers modifiers, ClassKeyword keyword, string className, params string[]? baseNames)
 {
     WriteIndent();
     _writer.Write($"{access.ToCode()} {modifiers.ToCode()} {keyword.ToCode()} {className}");
     if (baseNames is not null && baseNames.Length > 0)
         _writer.Write($" : {String.Join(", ", baseNames)}");
     _writer.WriteLine();
     WriteIndent();
     _writer.WriteLine("{");
     IncrementIndent();
 }