XmlSchemaObjectCollection.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Author: Dwivedi, Ajay kumar
  2. // [email protected]
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining
  5. // a copy of this software and associated documentation files (the
  6. // "Software"), to deal in the Software without restriction, including
  7. // without limitation the rights to use, copy, modify, merge, publish,
  8. // distribute, sublicense, and/or sell copies of the Software, and to
  9. // permit persons to whom the Software is furnished to do so, subject to
  10. // the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be
  13. // included in all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. //
  23. using System;
  24. using System.Collections;
  25. namespace System.Xml.Schema
  26. {
  27. /// <summary>
  28. /// Summary description for XmlSchemaObjectCollection.
  29. /// </summary>
  30. public class XmlSchemaObjectCollection : System.Collections.CollectionBase
  31. {
  32. // private XmlSchemaObject parent;
  33. public XmlSchemaObjectCollection()
  34. {
  35. }
  36. public XmlSchemaObjectCollection(XmlSchemaObject parent)
  37. {
  38. // FIXME: how is it used publicly?
  39. // this.parent = parent;
  40. }
  41. // Properties
  42. public virtual XmlSchemaObject this[ int index ]
  43. {
  44. get
  45. {
  46. return (XmlSchemaObject) this.List[index];
  47. }
  48. set
  49. {
  50. this.List[index] = value;
  51. }
  52. }
  53. // Methods
  54. public int Add(XmlSchemaObject item)
  55. {
  56. return this.List.Add(item);
  57. }
  58. public bool Contains(XmlSchemaObject item)
  59. {
  60. return this.List.Contains(item);
  61. }
  62. public void CopyTo(XmlSchemaObject[] array, int index)
  63. {
  64. this.List.CopyTo(array,index);
  65. }
  66. public new XmlSchemaObjectEnumerator GetEnumerator ()
  67. {
  68. return new XmlSchemaObjectEnumerator(this.List);
  69. }
  70. public int IndexOf(XmlSchemaObject item)
  71. {
  72. return this.List.IndexOf(item);
  73. }
  74. public void Insert(int index, XmlSchemaObject item)
  75. {
  76. this.List.Insert(index, item);
  77. }
  78. protected override void OnClear()
  79. {
  80. }
  81. protected override void OnInsert(int index,object item)
  82. {
  83. }
  84. protected override void OnRemove(int index,object item)
  85. {
  86. }
  87. protected override void OnSet(int index,object oldValue,object newValue)
  88. {
  89. }
  90. public void Remove(XmlSchemaObject item)
  91. {
  92. this.List.Remove(item);
  93. }
  94. }
  95. }