예제 #1
0
        public static T Get <T>(string key, params string[] sections)
        {
            string val = Get(key, sections);

            if ("{null}".EndsWith(val))
            {
                return(default(T));
            }
            return(ConfigUtility.ParseTextValue <T>(val));
        }
예제 #2
0
        private static string GetConfigFilePath(System.Configuration.Configuration confFile, ConfigurationSection section)
        {
            string configSource = section.SectionInformation.ConfigSource;

            if (configSource == String.Empty)
            {
                return(Path.GetFullPath(confFile.FilePath));
            }
            else
            {
                return(ConfigUtility.Combine(Path.GetDirectoryName(confFile.FilePath), configSource));
            }
        }
예제 #3
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            applicationName          = ConfigUtility.GetStringValue(reader, "applicationName", DefaultConfig.ApplicationName);
            environment              = ConfigUtility.GetStringValue(reader, "environment", DefaultConfig.Environment);
            timeout                  = ConfigUtility.GetIntValue(reader, "timeout", DefaultConfig.Timeout);
            readwriteTimeout         = ConfigUtility.GetIntValue(reader, "readwriteTimeout", DefaultConfig.ReadWriteTimeout);
            timeInterval             = ConfigUtility.GetIntValue(reader, "timeInterval", DefaultConfig.TimerInterval);
            remoteConfigurationUrl   = ConfigUtility.GetStringValue(reader, "remoteConfigurationUrl", DefaultConfig.RemoteConfigurationUrl);
            localConfigurationFolder = ConfigUtility.GetStringValue(reader, "localConfigurationFolder", DefaultConfig.LocalConfigurationFolder);
            backupConfig             = ConfigUtility.GetBoolValue(reader, "backupConfig", DefaultConfig.BackupConfig);
            maxBackupFiles           = ConfigUtility.GetIntValue(reader, "maxBackupFiles", DefaultConfig.MaxBackupFiles);
            checkRemoteConfig        = ConfigUtility.GetBoolValue(reader, "checkRemoteConfig", DefaultConfig.CheckRemoteConfig);

            EnsureLocalApplicationFolder();
        }