2
0

XmlSchemaObjectCollection.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. this.parent = parent;
  39. }
  40. // Properties
  41. public virtual XmlSchemaObject this[ int index ]
  42. {
  43. get
  44. {
  45. return (XmlSchemaObject) this.List[index];
  46. }
  47. set
  48. {
  49. this.List[index] = value;
  50. }
  51. }
  52. // Methods
  53. public int Add(XmlSchemaObject item)
  54. {
  55. return this.List.Add(item);
  56. }
  57. public bool Contains(XmlSchemaObject item)
  58. {
  59. return this.List.Contains(item);
  60. }
  61. public void CopyTo(XmlSchemaObject[] array, int index)
  62. {
  63. this.List.CopyTo(array,index);
  64. }
  65. public new XmlSchemaObjectEnumerator GetEnumerator ()
  66. {
  67. return new XmlSchemaObjectEnumerator(this.List);
  68. }
  69. public int IndexOf(XmlSchemaObject item)
  70. {
  71. return this.List.IndexOf(item);
  72. }
  73. public void Insert(int index, XmlSchemaObject item)
  74. {
  75. this.List.Insert(index, item);
  76. }
  77. protected override void OnClear()
  78. {
  79. }
  80. protected override void OnInsert(int index,object item)
  81. {
  82. }
  83. protected override void OnRemove(int index,object item)
  84. {
  85. }
  86. protected override void OnSet(int index,object oldValue,object newValue)
  87. {
  88. }
  89. public void Remove(XmlSchemaObject item)
  90. {
  91. this.List.Remove(item);
  92. }
  93. }
  94. }