XmlElementAttributes.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // XmlElementAttributes.cs:
  3. //
  4. // Author:
  5. // John Donagher ([email protected])
  6. //
  7. // (C) 2002 John Donagher
  8. //
  9. using System.Collections;
  10. using System;
  11. namespace System.Xml.Serialization
  12. {
  13. /// <summary>
  14. /// Summary description for XmlElementAttributes.
  15. /// </summary>
  16. public class XmlElementAttributes : CollectionBase
  17. {
  18. public XmlElementAttribute this [int index] {
  19. get {
  20. return (XmlElementAttribute)List [index];
  21. }
  22. set {
  23. List [index] = value;
  24. }
  25. }
  26. public int Add (XmlElementAttribute attribute)
  27. {
  28. return List.Add (attribute);
  29. }
  30. public bool Contains(XmlElementAttribute attribute)
  31. {
  32. return List.Contains(attribute);
  33. }
  34. public int IndexOf(XmlElementAttribute attribute)
  35. {
  36. return List.IndexOf(attribute);
  37. }
  38. public void Insert(int index, XmlElementAttribute attribute)
  39. {
  40. List.Insert(index, attribute);
  41. }
  42. public void Remove(XmlElementAttribute attribute)
  43. {
  44. List.Remove(attribute);
  45. }
  46. public void CopyTo(XmlElementAttribute[] array,int index)
  47. {
  48. List.CopyTo(array, index);
  49. }
  50. internal void AddKeyHash (System.Text.StringBuilder sb)
  51. {
  52. if (Count == 0) return;
  53. sb.Append ("XEAS ");
  54. for (int n=0; n<Count; n++)
  55. this[n].AddKeyHash (sb);
  56. sb.Append ('|');
  57. }
  58. }
  59. }