예제 #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        static HISClientHelper()
        {
            GlobalSetting = HISGlobalSetting.Load();
            ClientSetting = HISClientSetting.Load();

            //Stopwatch watch = new Stopwatch();
            //watch.e
        }
        /// <summary>
        /// 加载HISGlobalSettingHttp.xml文件
        /// </summary>
        /// <param name="directories"></param>
        /// <returns></returns>
        public static HISGlobalSetting Load(string directories)
        {
            DirectoryInfo rootPathInfo      = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);//根目录
            string        destinationSubdir = rootPathInfo.FullName + "CONFIG\\" + "HISGlobalSettingHttp.xml";

            _instance = Load <HISGlobalSetting>(destinationSubdir);
            _instance.HTTPINFO.localConfigPath = rootPathInfo.FullName + "CONFIG\\";
            return(_instance);
        }
 /// <summary>
 /// 加载默认的全局配置文件(HISGlobalSetting.xml)
 /// </summary>
 /// <returns></returns>
 public static HISGlobalSetting Load()
 {
     if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory))
     {
         Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory);
     }
     if (_instance == null)
     {
         _instance = Load <HISGlobalSetting>(AppDomain.CurrentDomain.BaseDirectory + "HISGlobalSetting.xml");
     }
     return(_instance);
 }
        public static List <HTTPUpdateConfig> LoadZxtInfos(string path)
        {
            List <HTTPUpdateConfig> https = new List <HTTPUpdateConfig>();

            if (!string.IsNullOrEmpty(zxt))
            {
                _instance = null;
                _instance = Load <HISGlobalSetting>(path);
                https.Add(_instance.HTTPINFO);
            }
            return(https);
        }
        public static List <HTTPUpdateConfig> LoadHttpInfos()
        {
            List <HTTPUpdateConfig> https = new List <HTTPUpdateConfig>();

            if (!string.IsNullOrEmpty(UpdateDirectorys))
            {
                _instance = null;
                HTTPUpdateConfig hTTPUpdateConfig = Load(UpdateDirectorys.ToLower()).HTTPINFO;
                https.Add(hTTPUpdateConfig);
            }
            return(https);
        }
예제 #6
0
 static HISGlobalHelper()
 {
     GlobalSetting = HISGlobalSetting.Load();
     HttpConfigs   = HISGlobalSetting.LoadHttpInfos();
 }