From 6faabfbbd86d70c99e197a3d8cfcf7db0680d17f Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 18 Nov 2017 16:33:30 +0000 Subject: Fixed fork? --- ShiftOS.Engine/Terminal/TerminalBackend.cs | 46 ------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 ShiftOS.Engine/Terminal/TerminalBackend.cs (limited to 'ShiftOS.Engine/Terminal/TerminalBackend.cs') diff --git a/ShiftOS.Engine/Terminal/TerminalBackend.cs b/ShiftOS.Engine/Terminal/TerminalBackend.cs deleted file mode 100644 index e079d22..0000000 --- a/ShiftOS.Engine/Terminal/TerminalBackend.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace ShiftOS.Engine.Terminal -{ - public static class TerminalBackend - { - // The line below gets all the terminal commands in... well... the entire ShiftOS.Engine - public static IEnumerable instances = Assembly.GetExecutingAssembly().GetTypes() - .Where(t => t.IsSubclassOf(typeof(TerminalCommand)) && t.GetConstructor(Type.EmptyTypes) != null) - .Select(t => Activator.CreateInstance(t) as TerminalCommand); - - /// - /// Runs a terminal command. - /// - /// - /// Returns all the output from that command. - public static string RunCommand(string command) - { - string name; - try - { - name = command.Split(' ')[0]; - } - catch - { - name = command; - } - - var theParams = new string[command.Split(' ').Length - 1]; - Array.Copy(command.Split(' '), 1, theParams, 0, command.Split(' ').Length - 1); - - foreach (var instance in Instances) - { - if (instance.GetName() == name) - { - return instance.Run(theParams); - } - } - - return "The command cannot be found."; - } - } -} \ No newline at end of file -- cgit v1.2.3