Exemplo n.º 1
0
 /// <summary>
 /// Handles the setting of the Hostname and FQDNLookup values.
 /// </summary>
 /// <param name="config">The Application Configuration.</param>
 /// <param name="configFile">The conf file content.</param>
 private void MungeHostName(ApplicationConfiguration config, ConfigurationFile configFile)
 {
     if (configFile.ContainsKey(HostnameKey))
     {
         config.Hostname = configFile[HostnameKey];
     }
     else if (configFile.ContainsKey(FQDNookupKey) &&
              configFile[FQDNookupKey].IsTrueString())
     {
         config.Hostname = GetFQDN();
     }
     else
     {
         config.Hostname = Environment.MachineName;
     }
 }
Exemplo n.º 2
0
        private void ParseLine(ConfigurationFile config, string line, int lineNumber)
        {
            // TODO: Parse quoted string values
            var space = line.IndexOf(' ');
            var key = line.Substring(0, space);
            var value = line.Substring(space + 1);

            if (key == DirectiveLoadPlugin)
            {
                config.Plugins.Add(value);
                return;
            }

            if (config.ContainsKey(key))
            {
                _log.Debug("Overwriting value for '{0}' at line {1}", key, lineNumber);
            }

            config[key] = value;
        }