mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-05-04 08:32:52 +08:00

This makes it possible for encoders to output better representation of the actual objects instead of working with chopped up segments. * IAnsiConsole.Write now takes an IRenderable instead of segments * Calculating cell width does no longer require a render context * Removed RenderContext.LegacyConsole * Removed RenderContext.Encoding * Added Capabilities.Unicode
33 lines
956 B
C#
33 lines
956 B
C#
using System;
|
|
using Spectre.Console.Rendering;
|
|
|
|
namespace Spectre.Console
|
|
{
|
|
/// <summary>
|
|
/// Contains extension methods for <see cref="IAnsiConsole"/>.
|
|
/// </summary>
|
|
public static partial class AnsiConsoleExtensions
|
|
{
|
|
/// <summary>
|
|
/// Renders the specified object to the console.
|
|
/// </summary>
|
|
/// <param name="console">The console to render to.</param>
|
|
/// <param name="renderable">The object to render.</param>
|
|
[Obsolete("Consider using IAnsiConsole.Write instead.")]
|
|
public static void Render(this IAnsiConsole console, IRenderable renderable)
|
|
{
|
|
if (console is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(console));
|
|
}
|
|
|
|
if (renderable is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(renderable));
|
|
}
|
|
|
|
console.Write(renderable);
|
|
}
|
|
}
|
|
}
|