DBConfig.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace SysBaseLibs
  7. {
  8. public sealed class DBConfig
  9. {
  10. rsXmlNode _XmlNode = null;
  11. public DBConfig(string pcString)
  12. : this(rsXmlNode.ParseGenericXml((pcString == "" ? "<DBConifg></DBConifg>" : pcString)))
  13. {
  14. }
  15. public DBConfig(rsXmlNode poXmlNode)
  16. {
  17. _XmlNode = poXmlNode;
  18. if (_XmlNode == null)
  19. _XmlNode = new rsXmlNode("DBConifg", "");
  20. }
  21. public string ConnectionStr
  22. {
  23. get { return _XmlNode.GetChildValue("ConnectionStr"); }
  24. set { _XmlNode.SetChildValue("ConnectionStr", value); }
  25. }
  26. public string DBVersion
  27. {
  28. get { return _XmlNode.GetChildValue("DBVersion"); }
  29. set { _XmlNode.SetChildValue("DBVersion", value); }
  30. }
  31. public string DBType
  32. {
  33. get { return _XmlNode.GetChildValue("DBType"); }
  34. set { _XmlNode.SetChildValue("DBType", value); }
  35. }
  36. public string DBAssembly
  37. {
  38. get { return _XmlNode.GetChildValue("DBAssembly"); }
  39. set { _XmlNode.SetChildValue("DBAssembly", value); }
  40. }
  41. public override string ToString()
  42. {
  43. return _XmlNode.ToAllXmlString();
  44. }
  45. }
  46. }