using System; using System.ComponentModel; namespace Spectre.Console { /// /// Contains extension methods for . /// public static class ObsoleteRuleExtensions { /// /// Sets the rule title. /// /// The rule. /// The title. /// The same instance so that multiple calls can be chained. [Obsolete("Use Title(..) instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public static Rule SetTitle(this Rule rule, string title) { if (rule is null) { throw new ArgumentNullException(nameof(rule)); } if (title is null) { throw new ArgumentNullException(nameof(title)); } rule.Title = title; return rule; } /// /// Sets the rule style. /// /// The rule. /// The rule style. /// The same instance so that multiple calls can be chained. [Obsolete("Use Style(..) instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public static Rule SetStyle(this Rule rule, Style style) { if (rule is null) { throw new ArgumentNullException(nameof(rule)); } if (style is null) { throw new ArgumentNullException(nameof(style)); } rule.Style = style; return rule; } } }