• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MorganKryze / ConsoleAppVisuals / 7473998763

10 Jan 2024 11:06AM UTC coverage: 37.669% (+1.7%) from 35.959%
7473998763

push

github

MorganKryze
🤖 (ci and docs) remove obsolete attribute from coverage

365 of 1034 branches covered (0.0%)

Branch coverage included in aggregate %.

750 of 1926 relevant lines covered (38.94%)

157.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ConsoleAppVisuals/elements/Footer.cs
1
/*
2
    MIT License 2023 MorganKryze
3
    For full license information, please visit: https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/LICENSE
4
*/
5
namespace ConsoleAppVisuals;
6

7
/// <summary>
8
/// Defines the footer of the console window.
9
/// </summary>
10
/// <remarks>
11
/// For more information, refer to the following resources:
12
/// <list type="bullet">
13
/// <item><description><a href="https://morgankryze.github.io/ConsoleAppVisuals/">Documentation</a></description></item>
14
/// <item><description><a href="https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/Program.cs">Example Project</a></description></item>
15
/// </list>
16
/// </remarks>
17
public class Footer : Element
18
{
19
    #region Fields
20
    private (string, string, string) _text;
21
    #endregion
22

23
    #region Properties
24
    /// <summary>
25
    /// The placement of the footer.
26
    /// </summary>
27
    public override Placement Placement { get; set; } = Placement.BottomCenterFullWidth;
×
28

29
    /// <summary>
30
    /// The line of the footer in the console.
31
    /// </summary>
32
    public override int Line => Window.GetLineAvailable(Placement);
×
33

34
    /// <summary>
35
    /// The height of the footer.
36
    /// </summary>
37
    public override int Height => 1;
×
38

39
    /// <summary>
40
    /// The width of the footer.
41
    /// </summary>
42
    public override int Width => Console.WindowWidth;
×
43
    #endregion
44

45
    #region Constructor
46
    /// <summary>
47
    /// The natural constructor of the footer.
48
    /// </summary>
49
    /// <param name="leftText">The text on the left of the footer.</param>
50
    /// <param name="centerText">The text in the center of the footer.</param>
51
    /// <param name="rightText">The text on the right of the footer.</param>
52
    /// <remarks>
53
    /// For more information, refer to the following resources:
54
    /// <list type="bullet">
55
    /// <item><description><a href="https://morgankryze.github.io/ConsoleAppVisuals/">Documentation</a></description></item>
56
    /// <item><description><a href="https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/Program.cs">Example Project</a></description></item>
57
    /// </list>
58
    /// </remarks>
59
    public Footer(
×
60
        string leftText = " Footer Left",
×
61
        string centerText = " Footer Center",
×
62
        string rightText = "Footer Right"
×
63
    )
×
64
    {
65
        _text.Item1 = leftText;
×
66
        _text.Item2 = centerText;
×
67
        _text.Item3 = rightText;
×
68
    }
×
69
    #endregion
70

71
    #region Methods
72
    /// <summary>
73
    /// This method is used to update the text on the left of the footer.
74
    /// </summary>
75
    /// <param name="leftText">The new text on the left of the footer.</param>
76
    /// <remarks>
77
    /// For more information, refer to the following resources:
78
    /// <list type="bullet">
79
    /// <item><description><a href="https://morgankryze.github.io/ConsoleAppVisuals/">Documentation</a></description></item>
80
    /// <item><description><a href="https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/Program.cs">Example Project</a></description></item>
81
    /// </list>
82
    /// </remarks>
83
    public void UpdateLeftText(string leftText)
84
    {
85
        _text.Item1 = leftText;
×
86
    }
×
87

88
    /// <summary>
89
    /// This method is used to update the text in the center of the footer.
90
    /// </summary>
91
    /// <param name="centerText">The new text in the center of the footer.</param>
92
    /// <remarks>
93
    /// For more information, refer to the following resources:
94
    /// <list type="bullet">
95
    /// <item><description><a href="https://morgankryze.github.io/ConsoleAppVisuals/">Documentation</a></description></item>
96
    /// <item><description><a href="https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/Program.cs">Example Project</a></description></item>
97
    /// </list>
98
    /// </remarks>
99
    public void UpdateCenterText(string centerText)
100
    {
101
        _text.Item2 = centerText;
×
102
    }
×
103

104
    /// <summary>
105
    /// This method is used to update the text on the right of the footer.
106
    /// </summary>
107
    /// <param name="rightText">The new text on the right of the footer.</param>
108
    /// <remarks>
109
    /// For more information, refer to the following resources:
110
    /// <list type="bullet">
111
    /// <item><description><a href="https://morgankryze.github.io/ConsoleAppVisuals/">Documentation</a></description></item>
112
    /// <item><description><a href="https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/Program.cs">Example Project</a></description></item>
113
    /// </list>
114
    /// </remarks>
115
    public void UpdateRightText(string rightText)
116
    {
117
        _text.Item3 = rightText;
×
118
    }
×
119

120
    /// <summary>
121
    /// This method is used to render the footer on the console.
122
    /// </summary>
123
    protected override void RenderElementActions()
124
    {
125
        Core.WritePositionedString(_text.BannerToString(), TextAlignment.Center, true, Line, false);
×
126
    }
×
127
    #endregion
128
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc