Frame tool for C# console applications.
- About The Project
- How to get started
- Public Methods
- Example
- Contributing
- Bug / Issue Reporting
- License
- Contact
- Acknowledgements
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.
Nuget package: https://www.nuget.org/packages/TirsvadCLI.Frame/
dotnet add package TirsvadCLI.FrameIn the example you can see how to use the AnsiCode class.
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:
-
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.
-
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
centeristrue, 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.
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
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!
Distributed under the GPL-3.0 License.
Jens Tirsvad Nielsen - LinkedIn
- 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.




