static void DisplayAvailableCommands(CommandMenuItem menu, bool inner) { if (menu == null) { throw new ArgumentNullException("menu"); } CommandTable tb = new CommandTable(); if (!inner) { menu.IO.WriteLine(Lang.Get("Available_Commands") + ":"); menu.IO.WriteLine(""); tb.AddRow(tb.AddRow(Lang.Get("Short"), Lang.Get("Command")).MakeSeparator()); } bool entra = false; var abbreviations = menu.CommandAbbreviations().OrderBy(it => it.Key); foreach (var ab in abbreviations) { //if (ab.Value == null) //{ // menu.IO.Write(" "); //} //else //{ // menu.IO.Write(ab.Value.PadRight(3) + " | "); //} tb.AddRow(ab.Value, ab.Key)[0].Align = CommandTableCol.EAlign.Right; //menu.IO.WriteLine(ab.Key); entra = true; } if (entra) { menu.IO.WriteLine(tb.Output()); } if (!inner) { menu.IO.WriteLine(Lang.Get("Type_Help")); } }
static void DisplayAvailableCommands(CommandMenuItem menu, bool inner) { if (menu == null) { throw new ArgumentNullException("menu"); } CommandTable tb = new CommandTable(); if (!inner) { menu.IO.WriteLine(Lang.Get("Available_Commands") + ":"); menu.IO.WriteLine(""); tb.AddRow(tb.AddRow(Lang.Get("Short"), Lang.Get("Command")).MakeSeparator()); } bool entra = false; var abbreviations = menu.CommandAbbreviations().OrderBy(it => it.Key); foreach (var ab in abbreviations) { CommandTableRow row = tb.AddRow(ab.Value, ab.Key); row[0].Align = CommandTableCol.EAlign.Right; row[0].ForeColor = ConsoleColor.Yellow; entra = true; } if (entra) { tb.OutputColored(menu.IO); } if (!inner) { menu.IO.WriteLine(Lang.Get("Type_Help")); } }
static void DisplayAvailableCommands(CommandMenuItem menu, bool inner) { if (menu == null) throw new ArgumentNullException("menu"); CommandTable tb = new CommandTable(); if (!inner) { menu.IO.WriteLine(Lang.Get("Available_Commands") + ":"); menu.IO.WriteLine(""); tb.AddRow(tb.AddRow(Lang.Get("Short"), Lang.Get("Command")).MakeSeparator()); } bool entra = false; var abbreviations = menu.CommandAbbreviations().OrderBy(it => it.Key); foreach (var ab in abbreviations) { //if (ab.Value == null) //{ // menu.IO.Write(" "); //} //else //{ // menu.IO.Write(ab.Value.PadRight(3) + " | "); //} tb.AddRow(ab.Value, ab.Key)[0].Align = CommandTableCol.EAlign.Right; //menu.IO.WriteLine(ab.Key); entra = true; } if (entra) menu.IO.WriteLine(tb.Output()); if (!inner) menu.IO.WriteLine(Lang.Get("Type_Help")); }