diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Console/ConsoleDictionary.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Console/ConsoleDictionary.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Console/ConsoleDictionary.cs b/Software/Visual_Studio/Tango.Console/ConsoleDictionary.cs new file mode 100644 index 000000000..f0e1ab3f6 --- /dev/null +++ b/Software/Visual_Studio/Tango.Console/ConsoleDictionary.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Helpers; + +namespace Tango.Console +{ + public static class ConsoleDictionary + { + private static List<ConsoleKnownCommand> _knownCommands; + + public static List<ConsoleKnownCommand> GetKnownCommands() + { + if (_knownCommands == null) + { + _knownCommands = new List<ConsoleKnownCommand>(); + + String text = EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.Console.CMD.txt"); + + foreach (var line in text.ToLines()) + { + if (line.IsNotNullOrEmpty()) + { + ConsoleKnownCommand command = new ConsoleKnownCommand(); + String[] args = line.Split('\t'); + command.Name = args[0]; + command.Description = args[1].Replace("\"", ""); + _knownCommands.Add(command); + } + } + } + + return _knownCommands; + } + } +} |
