Extension functions for C# Console apps
- ConsoleText.CalcCharLength(char c)
- ConsoleText.CalcStringLength(string str)
- ConsoleText.IsWideChar(char c)
- ConsoleSc.PromptForInput = "some string"
- ConsoleSc.ReadLine()
And lots of overrides for more features.
# Keys and Shortcuts
Insert : Switch insert mode (when using insert mode, cursor is full size)
Backspace : Backspace (remove one character before cursor)
Delete : Delete (remove one character after cursor)
Ctrl + Backspace : Clear all characters before cursor
Ctrl + Delete : Clear all characters after cursor
Esc : Clear all characters.
Up arrow : Switch to the previous input history
Down arror : Switch to the next input history (when in history end, use this key will clear all characters)
- ConsoleSc.YesOrNo("message")
- ConsoleSc.Select<TEnum>("message")
- ConsoleSc.ReadForDateTime("message")
- ConsoleSc.PressAnyKeyToContinue()
// you can write some text when you are scanning
// and it will display well
Task.Run(() =>
{
while(true)
{
Thread.Sleep(1000);
ConsoleSc.WriteLine("Some text");
}
});
while(true)
{
string instr = ConsoleSc.ReadLine();
Console.Title = instr;
}