namespace Spectre.Console.Rendering; /// /// Base class for a renderable object implementing . /// public abstract class Renderable : IRenderable { /// [DebuggerStepThrough] Measurement IRenderable.Measure(RenderOptions options, int maxWidth) { return Measure(options, maxWidth); } /// [DebuggerStepThrough] IEnumerable IRenderable.Render(RenderOptions options, int maxWidth) { return Render(options, maxWidth); } /// /// Measures the renderable object. /// /// The render options. /// The maximum allowed width. /// The minimum and maximum width of the object. protected virtual Measurement Measure(RenderOptions options, int maxWidth) { return new Measurement(maxWidth, maxWidth); } /// /// Renders the object. /// /// The render options. /// The maximum allowed width. /// A collection of segments. protected abstract IEnumerable Render(RenderOptions options, int maxWidth); }