private static JObject ProcessInf(string Path) { // find all the GptTmpl.inf files List <string> gpttmplInfFiles = new List <string>(); try { gpttmplInfFiles = Directory.GetFiles(Path, "GptTmpl.inf", SearchOption.AllDirectories).ToList(); } catch (System.IO.DirectoryNotFoundException) { return(null); } // make a dict for our results Dictionary <string, JObject> processedInfsDict = new Dictionary <string, JObject>(); // iterate over the list of inf files we found foreach (string infFile in gpttmplInfFiles) { //parse the inf file into a manageable format JObject parsedInfFile = Parsers.ParseInf(infFile); //send the inf file to be assessed JObject assessedGpTmpl = AssessHandlers.AssessGptmpl(parsedInfFile); //add the result to our results processedInfsDict.Add(infFile, assessedGpTmpl); } return((JObject)JToken.FromObject(processedInfsDict)); }
private static JArray ProcessInf(string Path) { // find all the GptTmpl.inf files List <string> gpttmplInfFiles = new List <string>(); try { gpttmplInfFiles = Directory.GetFiles(Path, "GptTmpl.inf", SearchOption.AllDirectories).ToList(); } catch (System.IO.DirectoryNotFoundException) { return(null); } // make a JArray for our results JArray processedInfs = new JArray(); // iterate over the list of inf files we found foreach (string infFile in gpttmplInfFiles) { //parse the inf file into a manageable format JObject parsedInfFile = Parsers.ParseInf(infFile); //send the inf file to be assessed JObject assessedGpTmpl = AssessHandlers.AssessGptmpl(parsedInfFile); //add the result to our results if (assessedGpTmpl.HasValues) { processedInfs.Add(assessedGpTmpl); } } return(processedInfs); }
private static JArray ProcessInf(string path) { // find all the GptTmpl.inf files List <string> gpttmplInfFiles = new List <string>(); try { gpttmplInfFiles = Directory.GetFiles(path, "GptTmpl.inf", SearchOption.AllDirectories).ToList(); } catch (DirectoryNotFoundException e) { if (GlobalVar.DebugMode) { Utility.DebugWrite(e.ToString()); } return(null); } catch (UnauthorizedAccessException e) { if (GlobalVar.DebugMode) { Utility.DebugWrite(e.ToString()); } return(null); } // make a JArray for our results JArray processedInfs = new JArray(); // iterate over the list of inf files we found foreach (string infFile in gpttmplInfFiles) { //parse the inf file into a manageable format JObject parsedInfFile = new JObject(); try { parsedInfFile = Parsers.ParseInf(infFile); } catch (UnauthorizedAccessException e) { if (GlobalVar.DebugMode) { Utility.DebugWrite(e.ToString()); } } //send the inf file to be assessed JObject assessedGpTmpl = AssessHandlers.AssessGptmpl(parsedInfFile); //add the result to our results if (assessedGpTmpl.HasValues) { processedInfs.Add(assessedGpTmpl); } } return(processedInfs); }