private void ProcessAsXmlDirectory(string xmlSourcePath, string optionName, OptionsParser.ResultType resultType) { if (!Directory.Exists(xmlSourcePath)) { throw new ArgumentException(string.Format("{0} directory `{1}` cannot be found", optionName, xmlSourcePath)); } var xmlFileNames = GetAllXmlFileNames(xmlSourcePath).ToArray(); if (!xmlFileNames.Any()) { throw new ArgumentException(string.Format("{0} directory `{1}` doesn't contain any .xml files.", optionName, xmlSourcePath)); } switch (resultType) { case OptionsParser.ResultType.Test: ResultXmlDirectoryPaths.Add(xmlSourcePath); break; case OptionsParser.ResultType.Baseline: BaselineXmlDirectoryPaths.Add(xmlSourcePath); break; default: throw new InvalidEnumArgumentException(resultType.ToString()); } }
private void ProcessAsXmlDirectory(string xmlSourcePath, string optionName, OptionsParser.ResultType resultType) { if (!Directory.Exists(xmlSourcePath)) { throw new ArgumentException(string.Format("{0} directory `{1}` cannot be found", optionName, xmlSourcePath)); } var xmlFileNames = GetAllXmlFileNames(xmlSourcePath).ToArray(); if (!xmlFileNames.Any()) { throw new ArgumentException(string.Format("{0} directory `{1}` doesn't contain any .xml files.", optionName, xmlSourcePath)); } ResultXmlDirectoryPaths.Add(xmlSourcePath); }