XmlSchemaCollection.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Author: Dwivedi, Ajay kumar
  2. // [email protected]
  3. using System;
  4. using System.Collections;
  5. using System.Xml;
  6. namespace System.Xml.Schema
  7. {
  8. /// <summary>
  9. /// Summary description for XmlSchemaCollection.
  10. /// </summary>
  11. public sealed class XmlSchemaCollection : ICollection, IEnumerable
  12. {
  13. //private fields
  14. private Hashtable htable;
  15. private XmlNameTable ntable;
  16. [MonoTODO]
  17. public XmlSchemaCollection()
  18. {
  19. htable = new Hashtable();
  20. ntable = new NameTable();
  21. }
  22. public XmlSchemaCollection(XmlNameTable nametable)
  23. {
  24. htable = new Hashtable();
  25. ntable = nametable;
  26. }
  27. //properties
  28. public int Count
  29. {
  30. get
  31. {
  32. return this.htable.Count;
  33. }
  34. }
  35. public XmlSchema this[ string ns ]
  36. {
  37. get
  38. {
  39. return (XmlSchema) this.htable[ns];
  40. }
  41. }
  42. public XmlNameTable NameTable
  43. {
  44. get
  45. {
  46. return this.ntable;
  47. }
  48. }
  49. // Events
  50. public event ValidationEventHandler ValidationEventHandler;
  51. // Methods
  52. [MonoTODO]
  53. public XmlSchema Add(string ns, XmlReader reader)
  54. {
  55. return null;
  56. }
  57. [MonoTODO]
  58. public XmlSchema Add(string ns, string uri)
  59. {
  60. return null;
  61. }
  62. [MonoTODO]
  63. public XmlSchema Add(XmlSchema schema)
  64. {
  65. return null;
  66. }
  67. public void Add(XmlSchemaCollection schema)
  68. {
  69. XmlSchemaCollectionEnumerator xenum = schema.GetEnumerator();
  70. while(xenum.MoveNext())
  71. {
  72. this.Add(xenum.Current);
  73. }
  74. }
  75. public bool Contains(string ns)
  76. {
  77. return this.htable.Contains(ns);
  78. }
  79. public bool Contains(XmlSchema schema)
  80. {
  81. return this.htable.Contains(schema.TargetNamespace);
  82. }
  83. public void CopyTo(XmlSchema[] array, int index)
  84. {
  85. }
  86. public XmlSchemaCollectionEnumerator GetEnumerator()
  87. {
  88. return new XmlSchemaCollectionEnumerator(this.htable);
  89. }
  90. //assembly Methods
  91. [MonoTODO]
  92. void ICollection.CopyTo(Array array, int index)
  93. {
  94. }
  95. bool ICollection.IsSynchronized
  96. {
  97. get { return false; }
  98. }
  99. IEnumerator IEnumerable.GetEnumerator()
  100. {
  101. return this.htable.GetEnumerator();
  102. }
  103. Object ICollection.SyncRoot
  104. {
  105. get { return this; }
  106. }
  107. }
  108. }