Ejemplo n.º 1
0
 public override void GenerateToString(StructuredStringBuilder sb, string name, Accessor accessor, string sbAccessor)
 {
     sb.AppendLine($"sb.{nameof(StructuredStringBuilder.AppendLine)}(\"{name} =>\");");
     sb.AppendLine($"using (sb.Brace())");
     using (sb.CurlyBrace())
     {
         sb.AppendLine($"foreach (var subItem in {accessor.Access})");
         using (sb.CurlyBrace())
         {
             sb.AppendLine($"using ({sbAccessor}.Brace())");
             using (sb.CurlyBrace())
             {
                 KeyTypeGen.GenerateToString(sb, "Key", new Accessor("subItem.Key"), sbAccessor);
                 ValueTypeGen.GenerateToString(sb, "Value", new Accessor("subItem.Value"), sbAccessor);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public override void GenerateToString(StructuredStringBuilder sb, string name, Accessor accessor, string sbAccessor)
 {
     subGenerator.GenerateToString(sb, name, accessor, sbAccessor);
 }