TirsvadCLI.Frame
0.1.2
dotnet add package TirsvadCLI.Frame --version 0.1.2
NuGet\Install-Package TirsvadCLI.Frame -Version 0.1.2
<PackageReference Include="TirsvadCLI.Frame" Version="0.1.2" />
<PackageVersion Include="TirsvadCLI.Frame" Version="0.1.2" />
<PackageReference Include="TirsvadCLI.Frame" />
paket add TirsvadCLI.Frame --version 0.1.2
#r "nuget: TirsvadCLI.Frame, 0.1.2"
#addin nuget:?package=TirsvadCLI.Frame&version=0.1.2
#tool nuget:?package=TirsvadCLI.Frame&version=0.1.2
Frame handler
Frame tool for C# console applications.
Table of Contents
- About The Project
- How to get started
- Public Methods
- Example
- Contributing
- Bug / Issue Reporting
- License
- Contact
- Acknowledgements
About The Project
Frame tool for C# console applications. Create a frame with text inside. Frame can be centered to windows.
Frame can be filled with a character and colored.
How to get started
Nuget package: https://www.nuget.org/packages/TirsvadCLI.Frame/
Installation
dotnet add package TirsvadCLI.Frame
Example
In the example you can see how to use the AnsiCode class.
Public Methods
The Frame
class provides several methods to create and customize frames in console applications.
Below is a list of the public methods and their descriptions:
Constructors
Frame()
- Initializes a frame with default dimensions, border characters, and colors.
Frame(int windowWidth, int windowHeight, int? frameWidth = null, int? frameHeight = null, char leftTop = '╔', char rightTop = '╗', char leftBottom = '╚', char rightBottom = '╝', char horizontal = '═', char vertical = '║')
- Creates a frame with specified dimensions and optional custom border characters.
Frame(int windowWidth, int windowHeight, string[] frameText, int? frameWidth = null, int? frameHeight = null, char leftTop = '╔', char rightTop = '╗', char leftBottom = '╚', char rightBottom = '╝', char horizontal = '═', char vertical = '║')
- Creates a frame with text inside and optional custom dimensions and border characters.
Methods
SetStartPosition((int Left, int Top) startPosition)
- Sets the starting position of the frame on the console.
SetColorBg(ConsoleColor color)
- Sets the background color for both the frame and text.
SetColorFg(ConsoleColor color)
- Sets the foreground color for both the frame and text.
SetTextColorBg(ConsoleColor color)
- Sets the background color of the text inside the frame.
SetTextColorFg(ConsoleColor color)
- Sets the foreground color of the text inside the frame.
SetFrameColorBg(ConsoleColor color)
- Sets the background color of the frame.
SetFrameColorFg(ConsoleColor color)
- Sets the foreground color of the frame.
SetFrameText(string title)
- Sets a single line of text inside the frame.
SetFrameText(List<string> title)
- Sets multiple lines of text inside the frame.
Render(bool center = false)
- Renders the frame on the console. If
center
istrue
, the frame is centered on the screen.
- Renders the frame on the console. If
FrameText(ICollection<string> texts, bool centerText = false)
- Frames the provided text and optionally centers it.
CenterText(string text, int width)
- Centers a single line of text within the specified width.
These methods allow you to create visually appealing and customizable frames for console applications. For usage examples, refer to the Example section.
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Bug / Issue Reporting
If you encounter a bug or have an issue to report, please follow these steps:
Go to the Issues Page
Navigate to the GitHub Issues page.Click "New Issue"
Click the green "New Issue" button to create a new issue.Provide Details
- Title: Write a concise and descriptive title for the issue.
- Description: Include the following details:
- Steps to reproduce the issue.
- Expected behavior.
- Actual behavior.
- Environment details (e.g., OS, .NET version, etc.).
- Attachments: Add screenshots, logs, or any other relevant files if applicable.
- Submit the Issue
Once all details are filled in, click "Submit new issue" to report it.
Your feedback is valuable and helps improve the project!
License
Distributed under the GPL-3.0 License.
Contact
Jens Tirsvad Nielsen - LinkedIn
Acknowledgements
- Microsoft .NET - The framework used for this project.
- NuGet - For package management and distribution.
- GitHub - For version control and collaboration.
- Shields.io - For creating the badges used in this README.
- Visual Studio - For providing a powerful IDE for .NET development.
- Stack Overflow - For community support and answers to programming questions.
- Contributors - Thanks to all contributors who have helped improve this project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.2 | 180 | 4/10/2025 |
0.1.0 | 179 | 4/8/2025 |
0.1.0-alpha.6 | 130 | 3/30/2025 |
0.1.0-alpha.4 | 105 | 3/28/2025 |