TirsvadCLI.Frame 0.1.2

dotnet add package TirsvadCLI.Frame --version 0.1.2
                    
NuGet\Install-Package TirsvadCLI.Frame -Version 0.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TirsvadCLI.Frame" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TirsvadCLI.Frame" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="TirsvadCLI.Frame" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TirsvadCLI.Frame --version 0.1.2
                    
#r "nuget: TirsvadCLI.Frame, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=TirsvadCLI.Frame&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=TirsvadCLI.Frame&version=0.1.2
                    
Install as a Cake Tool

NuGet Downloads Contributors Forks Stargazers Issues MIT License LinkedIn

Logo Frame handler

Frame tool for C# console applications.

Screenshot 1Screenshot 2Screenshot 3Screenshot 4

Table of Contents

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

  1. Frame()

    • Initializes a frame with default dimensions, border characters, and colors.
  2. 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.
  3. 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

  1. SetStartPosition((int Left, int Top) startPosition)

    • Sets the starting position of the frame on the console.
  2. SetColorBg(ConsoleColor color)

    • Sets the background color for both the frame and text.
  3. SetColorFg(ConsoleColor color)

    • Sets the foreground color for both the frame and text.
  4. SetTextColorBg(ConsoleColor color)

    • Sets the background color of the text inside the frame.
  5. SetTextColorFg(ConsoleColor color)

    • Sets the foreground color of the text inside the frame.
  6. SetFrameColorBg(ConsoleColor color)

    • Sets the background color of the frame.
  7. SetFrameColorFg(ConsoleColor color)

    • Sets the foreground color of the frame.
  8. SetFrameText(string title)

    • Sets a single line of text inside the frame.
  9. SetFrameText(List<string> title)

    • Sets multiple lines of text inside the frame.
  10. Render(bool center = false)

    • Renders the frame on the console. If center is true, the frame is centered on the screen.
  11. FrameText(ICollection<string> texts, bool centerText = false)

    • Frames the provided text and optionally centers it.
  12. 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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Bug / Issue Reporting

If you encounter a bug or have an issue to report, please follow these steps:

  1. Go to the Issues Page
    Navigate to the GitHub Issues page.

  2. Click "New Issue"
    Click the green "New Issue" button to create a new issue.

  3. 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.
  1. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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