Table of Contents

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 string

The text on the left of the banner.

centerText string

The text in the center of the banner.

rightText string

The text on the right of the banner.

upperMargin int

The upper margin of the banner.

lowerMargin int

The lower margin of the banner.

placement Placement

The 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

int

LowerMargin

Gets the lower margin of the banner.

public int LowerMargin { get; }

Property Value

int

Placement

Gets the placement of the banner.

public override Placement Placement { get; }

Property Value

Placement

Text

Gets the text of the banner.

public (string, string, string) Text { get; }

Property Value

(string, string, string)

UpperMargin

Gets the upper margin of the banner.

public int UpperMargin { get; }

Property Value

int

Width

Gets the width of the banner.

public override int Width { get; }

Property Value

int

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 string

The 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 string

The 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 int

The 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 Placement

The 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 string

The 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 int

The 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.