static void Main(string[] args) { var menu = new EasyConsole.Menu() .Add("Sum Even Numbers in an array - For loop", () => sumEvenNumbersInAnArray()) .Add("Sum Numbers in an array - Extension method", () => ConvertArrayToListAndSumWithExtensionMethod()) .Add("Check if string is a palindrome", () => CheckIfPalindrome()) .Add("Exit", () => Environment.Exit(0)); menu.Display(); //ConvertArrayToListAndSumWithExtensionMethod(); //Environment.Exit(0); // //sumEvenNumbersInAnArray(); // //SumDigitsInANumber(); // // //int num, sum = 0, r; //Console.WriteLine("Enter a number: "); //num = int.Parse(Console.ReadLine()); //Console.WriteLine(num); //while (num != 0) //{ // r = num % 10; // sum = sum + r; // num /= 10 ; // //} //Console.WriteLine("Sum of the digits: {0}", sum); Console.WriteLine("Press and key to continue..."); Console.ReadLine(); }
internal static void Start() { var menu = new EasyConsole.Menu() .Add("foo", () => Console.WriteLine("foo selected")) .Add("bar", () => Console.WriteLine("bar selected")); menu.Display(); }
public void Run() { // Add extra menu options here var menu = new EasyConsole.Menu() .AddSync("List all publications", ListAllPublications) .AddSync("Get individual publication", GetIndividualPublication) .AddSync("Get all researchers", ListAllResearchers) .AddSync("Get Three Year Average", GetThreeYearAverage) .AddSync("Get Performance", GetPerformance); while (true) { menu.Display(default);
public static void Main() { Console.Clear(); Console.WriteLine("Advent Of Code 2019"); Console.WriteLine("by André K."); Console.WriteLine(""); var menu = new EasyConsole.Menu() .Add("Day 1", () => Days.Day1.Execute()) .Add("Day 2", () => Days.Day2.Execute()) .Add("Day 3", () => Days.Day3.Execute()); menu.Display(); }
public static void Main() { Console.Clear(); Console.WriteLine("Advent Of Code 2018"); Console.WriteLine("by André K."); Console.WriteLine(""); var menu = new EasyConsole.Menu() .Add("Day 1", () => Days.Day1.execute()) .Add("Day 2", () => Days.Day2.execute()) .Add("Day 3", () => Days.Day3.execute()) .Add("Day 4", () => Days.Day4.execute()) .Add("Day 5", () => Days.Day5.execute()) .Add("Day 6", () => ThereIsNoDay6()) .Add("Day 7", () => Days.Day7.execute()); menu.Display(); }
static void Main(string[] args) { var exit = false; while (true) { var menu = new EasyConsole.Menu() .Add("Get module info", () => GetActorInfo()) .Add("Add produced event", () => AddProducedEvent()) .Add("Get sim data", () => GetSimData()) .Add("Get all modules", () => GetAllModules()) .Add("Quit", () => exit = true); menu.Display(); if (exit) { break; } } }
static void Main(string[] args) { Console.Title = $"{nameof(HoNCameraHack)} - {Version}"; var honinfo = new HoNInfos(); if (!string.IsNullOrEmpty(honinfo.DllPath)) { Console.WriteLine($"DLL Path: {honinfo.DllPath}"); Console.WriteLine($"HoN Version: {honinfo.Version}\n"); if (!Program.IsAdministrator) { Output.WriteLine(ConsoleColor.DarkRed, "You should run this program as Administrator or it may fail\n"); } try { Console.WriteLine($"Default values: Find => {honinfo.FindValue} / Patch => {honinfo.PatchValue} "); var addresses = honinfo.FindOffset(); switch (addresses.Count()) { case 0: { Output.WriteLine(ConsoleColor.Red, @"/!\ No offset found :( already patched?"); break; } case 1: { var offset = addresses.First(); Console.WriteLine($"Offset found! {offset:X}"); if (honinfo.Patch(offset)) { Output.WriteLine(ConsoleColor.Green, "PATCHED!"); } else { Output.WriteLine(ConsoleColor.Red, "Unable to patch :("); } break; } default: { var menu = new EasyConsole.Menu(); Output.WriteLine(ConsoleColor.Yellow, @"/!\ Multiple offsets found"); Console.WriteLine($"recommended to patch the first"); for (int i = 0; i < addresses.Count(); i++) { var address = addresses[i]; menu.Add($"{address:X}", () => { if (honinfo.Patch(address)) { Output.WriteLine(ConsoleColor.Green, "PATCHED!"); } else { Output.WriteLine(ConsoleColor.Red, "Unable to patch :("); } }); } menu.Display(); break; } } } catch (Exception ex) { Output.WriteLine(ConsoleColor.DarkRed, $"{ex.GetType()} => {ex.Message}" + Environment.NewLine); } } else { Output.WriteLine(ConsoleColor.Red, "HoN not found :("); } Output.WriteLine(ConsoleColor.Gray, "Press any key to close..."); Console.ReadLine(); }