XmlDsigNodeList.cs 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // XmlDsigNodeList.cs - derived node list class for dsig
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // (C)2004 Novell Inc.
  8. //
  9. // This class is mostly copied from System.Xml/XmlNodeArrayList.cs
  10. //
  11. using System;
  12. using System.Collections;
  13. using System.Xml;
  14. namespace System.Security.Cryptography.Xml
  15. {
  16. // Copied from XmlNodeArrayList.cs
  17. internal class XmlDsigNodeList : XmlNodeList
  18. {
  19. ArrayList _rgNodes;
  20. public XmlDsigNodeList (ArrayList rgNodes)
  21. {
  22. _rgNodes = rgNodes;
  23. }
  24. public override int Count { get { return _rgNodes.Count; } }
  25. public override IEnumerator GetEnumerator ()
  26. {
  27. return _rgNodes.GetEnumerator ();
  28. }
  29. public override XmlNode Item (int index)
  30. {
  31. // Return null if index is out of range. by DOM design.
  32. if (index < 0 || _rgNodes.Count <= index)
  33. return null;
  34. return (XmlNode) _rgNodes [index];
  35. }
  36. }
  37. }