コード例 #1
0
 public static IR1Top RProjectUnit(this IR1Top r1Top, IGProjectUnit gProjectUnit, IW1Top w1Top)
 {
     r1Top.Ct?.ThrowIfCancellationRequested();
     r1Top.Sb.RenderProjectUnitPreambleStringBuilder(gProjectUnit, r1Top.Indent, r1Top.Eol, r1Top.Ct);
     r1Top.Indent.Append(r1Top.IndentDelta);
     r1Top.Sb.Append(r1Top.Eol);
     r1Top.Sb.Append($"{r1Top.IndentDelta}{GProjectUnit.Header}{r1Top.Eol}");
     if (gProjectUnit.GPropertyGroupInProjectUnits.Any())
     {
         foreach (var kvp in gProjectUnit.GPropertyGroupInProjectUnits)
         {
             r1Top.RPropertyGroupInProjectUnit(kvp.Value);
         }
     }
     r1Top.Sb.Append(r1Top.Eol);
     if (gProjectUnit.GItemGroupInProjectUnits.Any())
     {
         foreach (var kvp in gProjectUnit.GItemGroupInProjectUnits)
         {
             r1Top.RItemGroupInProjectUnit(kvp.Value);
         }
     }
     r1Top.Sb.Append(r1Top.Eol);
     if (gProjectUnit.GResourceUnits.Any())
     {
         r1Top.Sb.Append($"{r1Top.Indent}<ItemGroup>{r1Top.Eol}");
         foreach (var kvp in gProjectUnit.GResourceUnits)
         {
             r1Top.RResourceUnitInProjectUnit(kvp.Value);
             r1Top.Sb.Append(r1Top.Eol);
         }
         r1Top.Sb.Append($"{r1Top.Indent}</ItemGroup>{r1Top.Eol}");
     }
     r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
     r1Top.Sb.RenderProjectUnitPostambleStringBuilder(gProjectUnit, r1Top.Indent, r1Top.Eol, r1Top.Ct);
     r1Top.Sb.Append(r1Top.Eol);
     w1Top.WProjectUnit(gProjectUnit, r1Top.Sb);
     return(r1Top);
 }