public static String GetVersion() { var configFilePath = ConfigFileLocator.GetConfigFilePath(); try { XDocument configFile = XDocument.Load(configFilePath); XElement element = configFile.XPathSelectElement( "WargameModInstallerConfig/Settings/General/" + GeneralSettingEntryType.WargameVersion); if (element != null) { return(element.Attribute("Version").ValueNullSafe() ?? element.ValueNullSafe()); } else { return(null); } } catch (XmlException ex) { WargameModInstaller.Common.Logging.LoggerFactory.Create(typeof(WargameVersionProvider)).Error(ex); throw; } }
public SettingsProvider( IGeneralSettingReader generalSettingsReader, IScreenSettingsReader screenSettingsReader, ISettingsFactory settingsFactory) { this.generalSettingsReader = generalSettingsReader; this.screenSettingsReader = screenSettingsReader; this.settingsFactory = settingsFactory; this.configFilePath = ConfigFileLocator.GetConfigFilePath(); this.placeholderReplacingFuncs = CreateTextPlaceholderReplacingFuncs(); this.ReplacePlaceholdersInDefaultScreenText = true; }