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
leftTextstringThe text on the left of the banner.
centerTextstringThe text in the center of the banner.
rightTextstringThe text on the right of the banner.
upperMarginintThe upper margin of the banner.
lowerMarginintThe lower margin of the banner.
placementPlacementThe 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
centerTextstringThe 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
leftTextstringThe 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
lowerMarginintThe 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
placementPlacementThe 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
rightTextstringThe 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
upperMarginintThe 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.