NameValueSectionHandler.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // System.Configuration.NameValueSectionHandler.cs
  3. //
  4. // Author:
  5. // Christopher Podurgiel ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. using System;
  10. using System.Xml;
  11. namespace System.Configuration
  12. {
  13. /// <summary>
  14. /// Summary description for NameValueSectionHandler.
  15. /// </summary>
  16. public class NameValueSectionHandler : IConfigurationSectionHandler
  17. {
  18. private static string _stringKey;
  19. private static string _stringValue;
  20. /// <summary>
  21. /// NameValueSectionHandler Constructor
  22. /// </summary>
  23. public NameValueSectionHandler()
  24. {
  25. _stringKey = "key";
  26. _stringValue = "value";
  27. }
  28. /// <summary>
  29. /// Creates a new configuration handler and adds the specified configuration object to the collection.
  30. /// </summary>
  31. /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
  32. /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
  33. /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
  34. /// <returns></returns>
  35. public object Create(object parent, object context, XmlNode section)
  36. {
  37. //FIXME: Add Implemetation code here.
  38. return null;
  39. }
  40. /// <summary>
  41. /// Gets the name of the key in the key-value pair.
  42. /// </summary>
  43. protected virtual string KeyAttributeName
  44. {
  45. get
  46. {
  47. return _stringKey;
  48. }
  49. }
  50. /// <summary>
  51. /// Gets the value for the key in the key-value pair.
  52. /// </summary>
  53. protected virtual string ValueAttributeName
  54. {
  55. get
  56. {
  57. return _stringValue;
  58. }
  59. }
  60. }
  61. }