NetConfigurationHandler.cs 729 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // System.Net.Configuration.NetConfigurationHandler.cs
  3. //
  4. // Authors:
  5. // Jerome Laban ([email protected])
  6. //
  7. // (C) 2003 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System.Collections;
  10. using System.Configuration;
  11. using System.Xml;
  12. namespace System.Net.Configuration
  13. {
  14. class NetConfigurationHandler : IConfigurationSectionHandler
  15. {
  16. public virtual object Create (object parent, object configContext, XmlNode section)
  17. {
  18. NetConfig config = new NetConfig();
  19. XmlNode node = section.SelectSingleNode("ipv6");
  20. if(node != null) {
  21. XmlAttribute attrib = node.Attributes["enabled"];
  22. if(attrib != null)
  23. config.ipv6Enabled = String.Compare (attrib.Value, "true", true) == 0;
  24. }
  25. return config;
  26. }
  27. }
  28. }