ACAT.Extensions.Default.FunctionalAgents.LaunchAppAgent.LaunchAppAgent.normalizeCommandLine C# (CSharp) Method

normalizeCommandLine() private method

Replace macros in the command line argument.
private normalizeCommandLine ( String commandLine ) : String
commandLine String command line
return String
        private String normalizeCommandLine(String commandLine)
        {
            if (String.IsNullOrEmpty(commandLine))
            {
                return String.Empty;
            }

            commandLine = commandLine.ToLower().Trim();
            if (commandLine.Contains("@mydocuments"))
            {
                commandLine = commandLine.Replace("@mydocuments",
                                                    Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            }
            else if (commandLine.Contains("@mymusic"))
            {
                commandLine = commandLine.Replace("@mymusic",
                                                    Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
            }
            else if (commandLine.Contains("@mypictures"))
            {
                commandLine = commandLine.Replace("@mypictures",
                                                    Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
            }
            else if (commandLine.Contains("@myvideos"))
            {
                commandLine = commandLine.Replace("@myvideos",
                                                    Environment.GetFolderPath(Environment.SpecialFolder.MyVideos));
            }

            return commandLine;
        }