12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /* ==============================================================================
- * 功能描述:Const
- * 创 建 者:Garrett
- * 创建日期:2019/1/29 11:49:28
- * ==============================================================================*/
- using System;
- using Update.Config;
- namespace Update
- {
- /// <summary>
- /// Const
- /// </summary>
- public class Const
- {
- public static string URL => ConfigUtils.GetAppSettingsConfig(nameof(Const.URL));
- public static string Key => ConfigUtils.GetAppSettingsConfig(nameof(Const.Key));
- //revit文件服务器id和密码
- public static readonly string RevitServiceId = ConfigUtils.GetAppSettingsConfig(nameof(Const.RevitServiceId));
- public static readonly string RevitServiceSecret = ConfigUtils.GetAppSettingsConfig(nameof(Const.RevitServiceSecret));
- //是否自动更新
- public static readonly bool IsAutoUpdate= ConvertToBoolean(ConfigUtils.GetAppSettingsConfig(nameof(Const.IsAutoUpdate)));
- private static bool ConvertToBoolean(string key)
- {
- bool result = false;
- try
- {
- result= Convert.ToBoolean(key);
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- return result;
- }
- }
- }
|