Skip to content

FUCKYOUORG/AdvancedConsole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AdvancedConsole

The testing code tells you how to use the library.

using System;

namespace AdvancedConsoleUnitTest
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var console = new AdvancedConsole.AdvancedConsole();
            string inR = "";
            console
                .Outf("Hello, {0}!", "World")
                .Out("\nTry input something: ")
                .In((context, s) =>
                {
                    inR = s;
                })
                .SetForeground(ConsoleColor.Red)
                .Out(inR)
                .SetForeground(ConsoleColor.Green)
                .RestoreColors()
                .EndLine()
                .Execute((context) =>
                {
                    inR = "Changed! (LOL)";
                })
                .Outf("Again, now inR = {0}\n", inR)
                .Out("[Press Z or Enter]Bye! ")
                .WaitForKeys(ConsoleKey.Z, ConsoleKey.Enter)
                .EndLine()
                .Out("Press any key...")
                .WaitForKey((c, k) =>
                {

                })
                .Out("\nFor testing, press Q please.")
                .WaitForKey(ConsoleKey.Q);
        }
    }
}

one method that not include in the example code is:

public AdvancedConsole AdvancedConsole.AdvancedConsole.MoveCursorTo(int x, int y);

That int x will set to the System.Console.CursorLeft and int y will set to the System.Console.CursorTop, then it will return this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages