PageRenderTime 59ms CodeModel.GetById 18ms RepoModel.GetById 0ms 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
Possible License(s): CC-BY-SA-3.0
  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. using System;
  10. using Microsoft.Web.Administration;
  11. namespace Web.Management.PHP.FastCgi
  12. {
  13. internal class EnvironmentVariablesCollection : ConfigurationElementCollectionBase<EnvironmentVariableElement>
  14. {
  15. public new EnvironmentVariableElement this[string name]
  16. {
  17. get
  18. {
  19. for (int i = 0; (i < this.Count); i = (i + 1))
  20. {
  21. EnvironmentVariableElement element = base[i];
  22. if ((string.Equals(element.Name, name, StringComparison.OrdinalIgnoreCase) == true))
  23. {
  24. return element;
  25. }
  26. }
  27. return null;
  28. }
  29. }
  30. public EnvironmentVariableElement Add(string name, string value)
  31. {
  32. EnvironmentVariableElement element = this.CreateElement();
  33. element.Name = name;
  34. element.Value = value;
  35. return base.Add(element);
  36. }
  37. }
  38. }