using System;
using System.ComponentModel;
namespace Spectre.Console
{
///
/// Represents a panel header.
///
public sealed class PanelHeader : IAlignable
{
///
/// Gets the panel header text.
///
public string Text { get; }
///
/// Gets or sets the panel header alignment.
///
public Justify? Alignment { get; set; }
///
/// Initializes a new instance of the class.
///
/// The panel header text.
/// The panel header alignment.
public PanelHeader(string text, Justify? alignment = null)
{
Text = text ?? throw new ArgumentNullException(nameof(text));
Alignment = alignment;
}
///
/// Sets the panel header style.
///
/// The panel header style.
/// The same instance so that multiple calls can be chained.
[Obsolete("Use markup instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PanelHeader SetStyle(Style? style)
{
return this;
}
///
/// Sets the panel header style.
///
/// The panel header style.
/// The same instance so that multiple calls can be chained.
[Obsolete("Use markup instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PanelHeader SetStyle(string style)
{
return this;
}
///
/// Sets the panel header alignment.
///
/// The panel header alignment.
/// The same instance so that multiple calls can be chained.
public PanelHeader SetAlignment(Justify alignment)
{
Alignment = alignment;
return this;
}
}
}