using System; using System.ComponentModel; namespace Spectre.Console { /// /// Contains extension methods for . /// public static class ObsoletePanelExtensions { /// /// Sets the panel header. /// /// The panel. /// The header text. /// The header style. /// The header alignment. /// The same instance so that multiple calls can be chained. [Obsolete("Use Header(..) instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public static Panel SetHeader(this Panel panel, string text, Style? style = null, Justify? alignment = null) { if (panel is null) { throw new ArgumentNullException(nameof(panel)); } if (text is null) { throw new ArgumentNullException(nameof(text)); } alignment ??= panel.Header?.Alignment; return SetHeader(panel, new PanelHeader(text, alignment)); } /// /// Sets the panel header. /// /// The panel. /// The header to use. /// The same instance so that multiple calls can be chained. [Obsolete("Use Header(..) instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public static Panel SetHeader(this Panel panel, PanelHeader header) { if (panel is null) { throw new ArgumentNullException(nameof(panel)); } panel.Header = header; return panel; } /// /// Sets the panel header style. /// /// The panel. /// The header style. /// The same instance so that multiple calls can be chained. [Obsolete("Use markup in header instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public static Panel HeaderStyle(this Panel panel, Style style) { return panel; } } }