View.Attribute.cs 675 B

123456789101112131415161718192021
  1. #nullable enable
  2. using System.ComponentModel;
  3. namespace Terminal.Gui;
  4. public partial class View
  5. {
  6. /// <summary>Selects the specified attribute as the attribute to use for future calls to AddRune and AddString.</summary>
  7. /// <remarks></remarks>
  8. /// <param name="attribute">THe Attribute to set.</param>
  9. public Attribute SetAttribute (Attribute attribute)
  10. {
  11. return Driver?.SetAttribute (attribute) ?? Attribute.Default;
  12. }
  13. /// <summary>Gets the current <see cref="Attribute"/>.</summary>
  14. /// <returns>The current attribute.</returns>
  15. public Attribute GetAttribute () { return Driver?.GetAttribute () ?? Attribute.Default; }
  16. }