XmlNodeWrapper.cs 985 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. Licensed Materials - Property of IBM
  3. IBM Cognos Products: DOCS
  4. (C) Copyright IBM Corp. 2005
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  6. IBM Corp.
  7. */
  8. using System;
  9. using System.Xml;
  10. namespace SamplesCommon
  11. {
  12. /// <summary>
  13. /// Summary description for XmlNodeWrapper.
  14. /// </summary>
  15. public class XmlNodeWrapper
  16. {
  17. private XmlNode m_node = null;
  18. private XmlNodeWrapper(){}
  19. public XmlNodeWrapper(XmlNode node)
  20. {
  21. m_node = node;
  22. }
  23. public XmlNode XMLNODE
  24. {
  25. set
  26. {
  27. m_node = value;
  28. }
  29. get
  30. {
  31. return m_node;
  32. }
  33. }
  34. public override string ToString()
  35. {
  36. return m_node.Attributes.GetNamedItem("name").InnerText;
  37. }
  38. public string PATH
  39. {
  40. get
  41. {
  42. string pkgPath = m_node.Attributes.GetNamedItem("_path").InnerText;
  43. //strip the pkg element from the path
  44. string path = pkgPath.Substring(pkgPath.IndexOf(".") + 1);
  45. return path;
  46. }
  47. }
  48. }
  49. }