public static bool GetValueAsBool(this ConfigSection section, string name, bool defaultValue) { bool result = defaultValue; if (section.HasValue(name)) { string value = section.GetValue(name); bool.TryParse(value, out result); } return(result); }
public static ReleaseVersion FromSection(ConfigSection section) { Version ver; try { ver = new Version(section.SubSection); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); return null; } return new ReleaseVersion() { Version = ver, ReleaseType = section.GetValue("ReleaseType"), DownloadPage = section.GetValue("DownloadPage") }; }