Class Banner
- Namespace
- ConsoleAppVisuals.PassiveElements
- Assembly
- ConsoleAppVisuals.dll
The Banner is a passive element that displays a banner on the console.
public class Banner : PassiveElement
- Inheritance
-
Banner
- Inherited Members
Remarks
For more information, consider visiting the documentation available here.
Constructors
Banner(string, string, string, int, int, Placement)
The Banner is a passive element that displays a banner on the console.
public Banner(string leftText = "Banner Left", string centerText = "Banner Center", string rightText = "Banner Right", int upperMargin = 0, int lowerMargin = 0, Placement placement = Placement.TopCenterFullWidth)
Parameters
leftText
stringThe text on the left of the banner.
centerText
stringThe text in the center of the banner.
rightText
stringThe text on the right of the banner.
upperMargin
intThe upper margin of the banner.
lowerMargin
intThe lower margin of the banner.
placement
PlacementThe placement of the banner.
Remarks
For more information, consider visiting the documentation available here.
Properties
Height
Gets the height of the banner.
public override int Height { get; }
Property Value
LowerMargin
Gets the lower margin of the banner.
public int LowerMargin { get; }
Property Value
Placement
Gets the placement of the banner.
public override Placement Placement { get; }
Property Value
Text
Gets the text of the banner.
public (string, string, string) Text { get; }
Property Value
UpperMargin
Gets the upper margin of the banner.
public int UpperMargin { get; }
Property Value
Width
Gets the width of the banner.
public override int Width { get; }
Property Value
Methods
RenderElementActions()
Defines the actions to perform when the element is called to be rendered on the console.
[Visual]
protected override void RenderElementActions()
UpdateCenterText(string)
Updates the text in the center of the banner.
public void UpdateCenterText(string centerText)
Parameters
centerText
stringThe new text in the center of the banner.
Remarks
For more information, consider visiting the documentation available here.
UpdateLeftText(string)
Updates the text on the left of the banner.
public void UpdateLeftText(string leftText)
Parameters
leftText
stringThe new text on the left of the banner.
Remarks
For more information, consider visiting the documentation available here.
UpdateLowerMargin(int)
Updates the lower margin of the banner.
public void UpdateLowerMargin(int lowerMargin)
Parameters
lowerMargin
intThe new lower margin of the banner.
Remarks
For more information, consider visiting the documentation available here.
Exceptions
- ArgumentOutOfRangeException
The lower margin of the banner must be between 0 and the height of the console window.
UpdatePlacement(Placement)
Updates the placement of the banner.
public void UpdatePlacement(Placement placement)
Parameters
placement
PlacementThe new placement of the banner.
Remarks
For more information, consider visiting the documentation available here.
UpdateRightText(string)
Updates the text on the right of the banner.
public void UpdateRightText(string rightText)
Parameters
rightText
stringThe new text on the right of the banner.
Remarks
For more information, consider visiting the documentation available here.
UpdateUpperMargin(int)
Updates the upper margin of the banner.
public void UpdateUpperMargin(int upperMargin)
Parameters
upperMargin
intThe new upper margin of the banner.
Remarks
For more information, consider visiting the documentation available here.
Exceptions
- ArgumentOutOfRangeException
The upper margin of the banner must be between 0 and the height of the console window.