コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: FormUpdates.cs プロジェクト: noamkfir/gitextensions
        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")
            };
        }