AttributeCollection.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // System.ComponentModel.AttributeCollection.cs
  3. //
  4. // Author: Rodrigo Moya ([email protected])
  5. //
  6. // (C) Ximian, Inc.
  7. //
  8. using System;
  9. using System.Collections;
  10. namespace System.ComponentModel
  11. {
  12. public class AttributeCollection : ICollection, IEnumerable
  13. {
  14. private ArrayList attrList;
  15. public static readonly AttributeCollection Empty;
  16. public AttributeCollection (Attribute[] attributes) {
  17. for (int i = 0; i < attributes.Length; i++)
  18. attrList.Add (attributes[i]);
  19. }
  20. public bool Contains (Attribute attr) {
  21. for (int i = 0; i < attrList.Count; i++) {
  22. if (attrList[i] == attr)
  23. return true;
  24. }
  25. return false;
  26. }
  27. [MonoTODO]
  28. public bool Contains (Attribute[] attributes) {
  29. throw new NotImplementedException ();
  30. }
  31. public void CopyTo (Array array, int index) {
  32. attrList.CopyTo (array, index);
  33. }
  34. public IEnumerator GetEnumerator () {
  35. return attrList.GetEnumerator ();
  36. }
  37. [MonoTODO]
  38. public bool Matches (Attribute attr) {
  39. throw new NotImplementedException ();
  40. }
  41. [MonoTODO]
  42. public bool Matches (Attribute[] attributes) {
  43. throw new NotImplementedException ();
  44. }
  45. [MonoTODO]
  46. protected Attribute GetDefaultAttribute (Type attributeType) {
  47. throw new NotImplementedException ();
  48. }
  49. public bool IsSynchronized {
  50. get {
  51. return attrList.IsSynchronized;
  52. }
  53. }
  54. public object SyncRoot {
  55. get {
  56. return attrList.SyncRoot;
  57. }
  58. }
  59. public int Count {
  60. get {
  61. return attrList.Count;
  62. }
  63. }
  64. public virtual Attribute this[Type type] {
  65. [MonoTODO]
  66. get {
  67. throw new NotImplementedException ();
  68. }
  69. }
  70. public virtual Attribute this[int index] {
  71. get {
  72. return (Attribute) attrList[index];
  73. }
  74. }
  75. }
  76. }