InstanceDataCollectionCollection.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // System.Diagnostics.InstanceDataCollectionCollection.cs
  3. //
  4. // Authors:
  5. // Jonathan Pryor ([email protected])
  6. //
  7. // (C) 2002
  8. //
  9. using System;
  10. using System.Collections;
  11. using System.Diagnostics;
  12. namespace System.Diagnostics {
  13. public class InstanceDataCollectionCollection : DictionaryBase {
  14. private static void CheckNull (object value, string name)
  15. {
  16. if (value == null)
  17. throw new ArgumentNullException (name);
  18. }
  19. // may throw ArgumentNullException
  20. public InstanceDataCollectionCollection ()
  21. {
  22. }
  23. // may throw ArgumentNullException
  24. public InstanceDataCollection this [string counterName] {
  25. get {
  26. CheckNull (counterName, "counterName");
  27. return (InstanceDataCollection) Dictionary [counterName];
  28. }
  29. }
  30. public ICollection Keys {
  31. get {return Dictionary.Keys;}
  32. }
  33. public ICollection Values {
  34. get {return Dictionary.Values;}
  35. }
  36. // may throw ArgumentNullException
  37. public bool Contains (string counterName)
  38. {
  39. CheckNull (counterName, "counterName");
  40. return Dictionary.Contains (counterName);
  41. }
  42. public void CopyTo (InstanceData[] counters, int index)
  43. {
  44. Dictionary.CopyTo (counters, index);
  45. }
  46. }
  47. }