/// <summary> /// Gets the FileInfo object for the xml file defining the shapes to be used by DOF. /// </summary> /// <returns>FileInfo object for the xml file defining the shapes to be used by DOF</returns> public FileInfo GetShapeDefinitionFile(string TableFilename = "", string RomName = "") { if (ShapeDefintionFilePattern != null && !ShapeDefintionFilePattern.Pattern.IsNullOrWhiteSpace() && ShapeDefintionFilePattern.IsValid) { return(ShapeDefintionFilePattern.GetFirstMatchingFile(GetReplaceValuesDictionary(TableFilename, RomName))); } Dictionary <int, FileInfo> IniFilesDict = GetIniFilesDictionary(TableFilename); if (IniFilesDict.Count > 0) { FileInfo FI = new FileInfo(Path.Combine(IniFilesDict.Select(KV => KV.Value).First().Directory.FullName, "DirectOutputShapes.xml")); if (FI.Exists) { return(FI); } } FileInfo FII = new FilePattern("{DllDir}\\DirectOutputShapes.xml").GetFirstMatchingFile(GetReplaceValuesDictionary(TableFilename, RomName)); if (FII != null && FII.Exists) { return(FII); } return(null); }
/// <summary> /// FileInfo object for the file containing the configuration of the cabinet (outputs, toys and so on). /// </summary> /// <returns>FileInfo object for the file containing the configuration of the cabinet or null if no file has been specified.</returns> public FileInfo GetCabinetConfigFile() { if (!CabinetConfigFilePattern.Pattern.IsNullOrWhiteSpace() && CabinetConfigFilePattern.IsValid) { return(CabinetConfigFilePattern.GetFirstMatchingFile(GetReplaceValuesDictionary())); } return(null); }