irek.Configuration.Config.Get C# (CSharp) Method

Get() public method

Gets the specified key.
public Get ( string key ) : string
key string The key.
return string
        public string Get(string key)
        {
            if (Map.ContainsKey((object)key))
            {
                string val = Map[key].ToString();
                return val;
            }
            else
            {
                throw new Errors.InvalidConfigurationKeyException("No key '" + key + "' was found in your configuration.");
            }
        }

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Listener"/> class.
 /// </summary>
 /// <param name="cfg">The Config Object.</param>
 public Listener(Config cfg, List<UrlMapItem> UrlMap, Hashtable modulelist)
 {
     port = int.Parse(cfg.Get("port"));
     config = cfg;
     GlobalUrlMap = UrlMap;
     ServicePointManager.DefaultConnectionLimit = 20;
     ModuleList = modulelist;
 }