-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console Messge #106
Comments
Hi,
internal static class Program
{
public static bool ExitWasRequested { get; set; }
private static void Main(string[] args)
{
ScrollMenu scrollMenu = new();
scrollMenu.AddItems(new[]
{
new LabelMenuItem
{
Text = "Item 1",
Command = new Item1Command()
},
new LabelMenuItem
{
Text = "Item 2",
Command = new Item2Command()
},
new LabelMenuItem
{
Text = "Item 3",
Command = new Item3Command()
},
new LabelMenuItem
{
Text = "Exit",
Command = new ExitCommand()
}
}
);
while (!ExitWasRequested)
scrollMenu.Display();
}
}
internal class Item1Command : ICommand
{
public bool IsActive => true;
public void Execute()
{
CustomConsole.WriteLine("Item 1 was selected.");
}
}
internal class Item2Command : ICommand
{
public bool IsActive => true;
public void Execute()
{
CustomConsole.WriteLine("Item 2 was selected.");
}
}
internal class Item3Command : ICommand
{
public bool IsActive => true;
public void Execute()
{
CustomConsole.WriteLine("Item 3 was selected.");
}
}
internal class ExitCommand : ICommand
{
public bool IsActive => true;
public void Execute()
{
CustomConsole.WriteLine("Exit was selected.");
Program.ExitWasRequested = true;
}
}
|
Attached ticket: #107 |
I made a quick fix and released the version 1.2.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm starting using this tools , but have some questions
It's the a sample like that? How can I do?
Regards
The text was updated successfully, but these errors were encountered: