Skip to content

chris-dev-at/FancyConsole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

FancyConsole

A fancier version of the C-Sharp Console

Example

image

void Main(){
FancyConsole.FancyConsole.OnFancyConsoleInput += Input; // This has to be added before Activate. If added after you need to execute input once before this method gets alerted!
            FancyConsole.Activate();
            FancyConsole.ContentBackgroundColor = ConsoleColor.Black;
            FancyConsole.InputBackgroundColor = ConsoleColor.Red;
            FancyConsole.InputForegroundColor = ConsoleColor.Black;
            FancyConsole.ShowOverflow = false;
            FancyConsole.Input_Prefix = "> ";
            FancyConsole.Title = "--[FancyConsole]--";
            FancyConsole.WriteLine("For multiple line outputs");
            FancyConsole.WriteLine("Use the WriteLine Command");
            FancyConsole.WriteLine("After you are finished");
            FancyConsole.WriteLine("Execute the Display Command");
            FancyConsole.WriteLine("Like this");
            FancyConsole.WriteLine("--TESTING--");
            FancyConsole.WriteLine("OVERFLOW TEST: igdfjbnafgsdijp oajsfdoja nfsdojnags fdagdf fgd dgf dfg dfg as rsojbojbsdf onjfds ojnüfa dsonjü fosdnajüa soedfjnü");


            //takes input and displays it
            void Input(string text)
            {
                if (text == "exit") Environment.Exit(0);
                FancyConsole.WriteLine(text);
                //FancyConsole.DisplayContent(); only needed if UpdateContentAfterWrite is false
            }
}

Functions

WriteLine(string text); => Displays text variable in the Console
Activate(); => Starts Displaying in the FanyConsole Format and starts the resize Listener
Deactivate(); => Stops the resize Listener and deactivates FancyConsole

Properties

Title => If not empty, the title gets displayed at the Top (string, Default: "")
ShowOverflow => Decides if Overflow is shown (bool, Default: true)
UpdateContentAfterWrite => Automatically updates the Interface after WriteLine() (bool, Default: true)
Input_Prefix => Input Prefix is shown in front of the Input-Line (string, Default: "")
TitleBackgroundColor => Background Color of the Title (if there is one) (ConsoleColor, Default: Gray)
TitleForegroundColor => Foreground Color of the Title (if there is one) (ConsoleColor, Default: Black)
ContentBackgroundColor => Background Color of the Content (ConsoleColor, Default: Black)
InputBackgroundColor => Background Color of the Input (ConsoleColor, Default: Black)
InputForegroundColor => Background Color of the Input (ConsoleColor, Default: Gray)

Events

> delegate void FancyChatInput => FancyChatInput(string text);

OnFancyConsoleInput => Gets Executed when there is an input in the Input-Line

Releases

No releases published

Packages

No packages published

Languages