ConsoleCompanion 1.2.2
See the version list below for details.
dotnet add package ConsoleCompanion --version 1.2.2
NuGet\Install-Package ConsoleCompanion -Version 1.2.2
<PackageReference Include="ConsoleCompanion" Version="1.2.2" />
paket add ConsoleCompanion --version 1.2.2
#r "nuget: ConsoleCompanion, 1.2.2"
// Install ConsoleCompanion as a Cake Addin
#addin nuget:?package=ConsoleCompanion&version=1.2.2
// Install ConsoleCompanion as a Cake Tool
#tool nuget:?package=ConsoleCompanion&version=1.2.2
A library with helper functions for console applications
Usage
using ConsoleCompanion
ConsoleCompanionHelper cc = new()
cc.AskForInt()
Methods
AskForInt
cc.AskForInt(questionString, errorMessageString)
cc.AskForInt(minValue, maxValue, questionString, errorMessageString)
AskForDouble
cc.AskForDouble(questionString, errorMessageString)
cc.AskForDouble(minValue, maxValue, questionString, errorMessageString)
AskForChar
cc.AskForChar(questionString)
cc.AskForChar(CharType.Letter/Digit, questionString, errorMessageString)
AskForString
cc.AskForString(questionString)
cc.AskForString(Regex, questionString, errorMessageString)
WriteError
Prints text in red
cc.WriteError(message)
WriteWarning
Prints text in yellow
cc.WriteWarning(message)
WriteSuccess
Prints text in green
cc.WriteSuccess(message)
WriteAtPosition
Writes text from given starting point
cc.WriteAtPosition(leftPostion message)
cc.WriteAtPosition(leftPostion, topPosition, message)
ClearConsoleLine
Erases text in the given line and sets the cursor back at the start of the same line
cc.ClearConsoleLine(lineNumber)
CreateMenu
Creates a menu that you can navigate with your arrow-keys, it returns the index of the chosen option
cc.CreateMenu(
// An array with strings to print as menu options
string[] options,
// The menu title
string menuTitle = "Menu options, select with enter:",
// Defines if you can go back out from the menu with ESC
bool canCancel = false,
// Starting column to print at
int startCol = 8,
// Starting row to print at
int startRow = 15,
// How many options per column
int optionsPerColumn = 3,
// Spacing between columns
int columnSpacing = 14,
// Should it print the menu numbers
bool enumerate = true
)
CreateMultipleChoiceMenu
Creates a menu that you can navigate with your arrow-keys and select multiple options with the spacebar, it will return a list on the indexes of the options chosen
cc.CreateMultipleChoiceMenu(
// An array with strings to print as menu options
string[] options,
// The menu title
string menuTitle = "Menu options, select with enter:",
// Defines if you can go back out from the menu with ESC
bool canCancel = false,
// Starting column to print at
int startCol = 8,
// Starting row to print at
int startRow = 15,
// How many options per column
int optionsPerColumn = 3,
// Spacing between columns
int columnSpacing = 14,
// Should it print the menu numbers
bool enumerate = true
)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.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.