PerformanceCounterPermissionEntryCollection.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // System.Diagnostics.PerformanceCounterPermissionEntryCollection.cs
  3. //
  4. // Authors:
  5. // Jonathan Pryor ([email protected])
  6. //
  7. // (C) 2002
  8. //
  9. using System;
  10. using System.Diagnostics;
  11. using System.Collections;
  12. using System.Globalization;
  13. namespace System.Diagnostics {
  14. [Serializable]
  15. public class PerformanceCounterPermissionEntryCollection
  16. : CollectionBase
  17. {
  18. internal PerformanceCounterPermissionEntryCollection ()
  19. {
  20. }
  21. public PerformanceCounterPermissionEntry this [int index] {
  22. get {
  23. return (PerformanceCounterPermissionEntry)
  24. InnerList[index];
  25. }
  26. set {InnerList[index] = value;}
  27. }
  28. public int Add (PerformanceCounterPermissionEntry value)
  29. {
  30. return InnerList.Add (value);
  31. }
  32. public void AddRange (PerformanceCounterPermissionEntry[] value)
  33. {
  34. foreach (PerformanceCounterPermissionEntry e in value)
  35. Add (e);
  36. }
  37. public void AddRange (
  38. PerformanceCounterPermissionEntryCollection value)
  39. {
  40. foreach (PerformanceCounterPermissionEntry e in value)
  41. Add (e);
  42. }
  43. public bool Contains (PerformanceCounterPermissionEntry value)
  44. {
  45. return InnerList.Contains (value);
  46. }
  47. public void CopyTo (PerformanceCounterPermissionEntry[] array,
  48. int index)
  49. {
  50. InnerList.CopyTo (array, index);
  51. }
  52. public int IndexOf (PerformanceCounterPermissionEntry value)
  53. {
  54. return InnerList.IndexOf (value);
  55. }
  56. public void Insert (int index,
  57. PerformanceCounterPermissionEntry value)
  58. {
  59. InnerList.Insert (index, value);
  60. }
  61. protected override void OnClear ()
  62. {
  63. }
  64. protected override void OnInsert (int index, object value)
  65. {
  66. if (!(value is PerformanceCounterPermissionEntry))
  67. throw new NotSupportedException (Locale.GetText(
  68. "You can only insert " +
  69. "PerformanceCounterPermissionEntry " +
  70. "objects into the collection."));
  71. }
  72. protected override void OnRemove (int index, object value)
  73. {
  74. }
  75. protected override void OnSet (int index,
  76. object oldValue,
  77. object newValue)
  78. {
  79. if (!(newValue is PerformanceCounterPermissionEntry))
  80. throw new NotSupportedException (Locale.GetText(
  81. "You can only insert " +
  82. "PerformanceCounterPermissionEntry " +
  83. "objects into the collection."));
  84. }
  85. public void Remove (PerformanceCounterPermissionEntry value)
  86. {
  87. InnerList.Remove (value);
  88. }
  89. }
  90. }