Files
spectre.console/src/Spectre.Console/Composition/SegmentLine.cs
Patrik Svensson f19202b427 Improve text composite
- A `Text` object should not be able to justify itself.
  All justification needs to be done by a parent.
- Apply colors and styles to part of a `Text` object
- Markup parser should return a `Text` object
2020-08-02 22:45:01 +02:00

19 lines
507 B
C#

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace Spectre.Console.Composition
{
/// <summary>
/// Represents a line of segments.
/// </summary>
[SuppressMessage("Naming", "CA1710:Identifiers should have correct suffix")]
public sealed class SegmentLine : List<Segment>
{
/// <summary>
/// Gets the length of the line.
/// </summary>
public int Length => this.Sum(line => line.Text.Length);
}
}