NameValueSectionHandler.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // System.Configuration.NameValueSectionHandler.cs
  3. //
  4. // Author:
  5. // Christopher Podurgiel ([email protected])
  6. //
  7. // (C) Chris Podurgiel
  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. //Set Default Values.
  26. _stringKey = "key";
  27. _stringValue = "value";
  28. }
  29. /// <summary>
  30. /// Creates a new configuration handler and adds the specified configuration object to the collection.
  31. /// </summary>
  32. /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
  33. /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
  34. /// <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>
  35. /// <returns></returns>
  36. public object Create(object parent, object context, XmlNode section)
  37. {
  38. //FIXME: Add Implemetation code here.
  39. return null;
  40. }
  41. /// <summary>
  42. /// Gets the name of the key in the key-value pair.
  43. /// </summary>
  44. protected virtual string KeyAttributeName
  45. {
  46. get
  47. {
  48. return _stringKey;
  49. }
  50. }
  51. /// <summary>
  52. /// Gets the value for the key in the key-value pair.
  53. /// </summary>
  54. protected virtual string ValueAttributeName
  55. {
  56. get
  57. {
  58. return _stringValue;
  59. }
  60. }
  61. }
  62. }