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); } } } }
public override void GenerateToString(StructuredStringBuilder sb, string name, Accessor accessor, string sbAccessor) { subGenerator.GenerateToString(sb, name, accessor, sbAccessor); }