示例#1
0
		public static YSection Load(string filename)
		{
#if RELEASE
			try {
#endif
				_last_type = YenconFormatRecognition.GetYenconType(filename);
				if (_last_type == YenconType.Text) {
					return _txt_cnvtr.Load(filename);
				} else if (_last_type == YenconType.Binary) {
					return _bin_cnvtr.Load(filename);
				} else {
					return null;
				}
#if RELEASE
			} catch (Exception e) {
				Program.ShowError(e);
				return null;
			}
#endif
		}
示例#2
0
        public static void Load()
        {
            if (!_is_initialized)
            {
                throw new ObjectDisposedException(nameof(SettingManager));
            }

            {             // system
                _p_system_inix = SystemPaths.Settings.Bond("system.inix");
                _p_system_cfg  = SystemPaths.DefaultSettings.Bond("system.cfg");
                _y_system_inix = File.Exists(_p_system_inix) ? _txt_cnvtr.Load(_p_system_inix) : new YSection();
                _y_system_cfg  = File.Exists(_p_system_cfg) ? _bin_cnvtr.Load(_p_system_cfg) : new YSection();
                System.EnsureAvailable();
                _logger.Info("loaded the configuration data of \'system\'");
            }             // system
        }