private bool ParseArguments()
        {
            for (int i = 0; i < _args.Length; i += 2)
            {
                switch (_args[i].ToLower())
                {
                case "-dumpfile":
                case "-folder":
                    if (!ValidateDumpFiles(_args[i + 1]))
                    {
                        return(false);
                    }
                    break;

                case "-monitorfolder":
                    _aj.MonitoredFolder = _args[i + 1];
                    break;

                case "-symbols":
                    _aj.Symbols = _args[i + 1];
                    break;

                case "-rules":
                    string rulesString = _args[i + 1];
                    _aj.Rules = rulesString.Split(',');
                    break;

                case "-out":
                    if (!FileValidator.Validate(_args[i + 1]))
                    {
                        return(false);
                    }
                    _aj.ReportPath = _args[i + 1];
                    break;

                case "-ruleassemblies":
                    string assemblylist = _args[i + 1];
                    if (!ValidateAssemblies(assemblylist))
                    {
                        return(false);
                    }
                    break;

                case "-showresults":
                    _aj.ShowResults = true;
                    i--;
                    break;

                default:
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
 public bool AddAssembly(string AssemblyName)
 {
     if (FileValidator.Validate(AssemblyName, true))
     {
         _assemblyNames.Add(AssemblyName);
     }
     else
     {
         ErrorHandler.ReportError("The following Assembly file was not be found and rules based on it will not be executed", AssemblyName);
         return(false);
     }
     return(true);
 }
示例#3
0
        public bool AddDumpFile(string dumpName)
        {
            string parsedDumpName = dumpName.Replace("\"", "");

            if (FileValidator.Validate(parsedDumpName, true))
            {
                _dumpFiles.Add(parsedDumpName);
            }
            else
            {
                ErrorHandler.ReportError("The following dump file was not be found and will not be analyzed:", parsedDumpName);
                return(false);
            }
            return(true);
        }