PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/stable-1.1.1/Server/FastCgi/EnvironmentVariablesCollection.cs

#
C# | 45 lines | 30 code | 7 blank | 8 comment | 3 complexity | 01d909372fc496b4a5a6b2afd78d8a91 MD5 | raw file
 1//-----------------------------------------------------------------------
 2// <copyright>
 3// Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
 4//
 5// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
 6// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
 7// </copyright>
 8//----------------------------------------------------------------------- 
 9
10using System;
11using Microsoft.Web.Administration;
12
13namespace Web.Management.PHP.FastCgi
14{
15
16    internal class EnvironmentVariablesCollection : ConfigurationElementCollectionBase<EnvironmentVariableElement>
17    {
18
19        public new EnvironmentVariableElement this[string name]
20        {
21            get
22            {
23                for (int i = 0; (i < this.Count); i = (i + 1))
24                {
25                    EnvironmentVariableElement element = base[i];
26                    if ((string.Equals(element.Name, name, StringComparison.OrdinalIgnoreCase) == true))
27                    {
28                        return element;
29                    }
30                }
31                return null;
32            }
33        }
34
35        public EnvironmentVariableElement Add(string name, string value)
36        {
37            EnvironmentVariableElement element = this.CreateElement();
38            element.Name = name;
39            element.Value = value;
40
41            return base.Add(element);
42        }
43
44    }
45}