Example #1
0
        public DecodedRunString Decoded(string command)
        {
            if (command == "")
            {
                return(null);
            }
            DecodedRunString decoded = new DecodedRunString();

            decoded.Name = command.Replace("Executable_", "").Split('=')[0].Trim();
            string[] path = command.Split('=');
            decoded.Path = path[1];
            if (command.Contains(","))
            {
                decoded.Path      = path[1].Split(',')[0].Trim();
                decoded.Arguments = command.Split(',')[1].Trim();
            }

            return(decoded);
        }
Example #2
0
        public void RemoveCommand(string command)
        {
            List <string> commands        = GetCommands();
            List <string> updatedCommands = new List <string>();

            commands.TrimExcess();
            foreach (string s in commands)
            {
                DecodedRunString decoded = Decoded(s);
                if (decoded.Name.ToLower() == command.ToLower())
                {
                    continue;
                }
                else
                {
                    updatedCommands.Add(s.Trim());
                }
            }
            SaveCommands(updatedCommands);
        }