1 //------------------------------------------------------------------------------
2 // <copyright file="InstanceDataCollectionCollection.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
7 namespace System.Diagnostics {
9 using System.Diagnostics;
11 using System.Collections;
12 using System.Globalization;
15 /// The collection returned from the <see cref='System.Diagnostics.PerformanceCounterCategory.ReadCategory'/> method.
16 /// that contains all the counter and instance data.
17 /// The collection contains an InstanceDataCollection object for each counter. Each InstanceDataCollection
18 /// object contains the performance data for all counters for that instance. In other words the data is
19 /// indexed by counter name and then by instance name.
21 public class InstanceDataCollectionCollection : DictionaryBase {
24 [Obsolete("This constructor has been deprecated. Please use System.Diagnostics.PerformanceCounterCategory.ReadCategory() to get an instance of this collection instead. http://go.microsoft.com/fwlink/?linkid=14202")]
25 public InstanceDataCollectionCollection() : base() {}
28 /// <para>[To be supplied.]</para>
30 public InstanceDataCollection this[string counterName] {
32 if (counterName == null)
33 throw new ArgumentNullException("counterName");
35 object objectName = counterName.ToLower(CultureInfo.InvariantCulture);
36 return (InstanceDataCollection) Dictionary[objectName];
41 /// <para>[To be supplied.]</para>
43 public ICollection Keys {
44 get { return Dictionary.Keys; }
48 /// <para>[To be supplied.]</para>
50 public ICollection Values {
52 return Dictionary.Values;
56 internal void Add(string counterName, InstanceDataCollection value) {
57 object objectName = counterName.ToLower(CultureInfo.InvariantCulture);
58 Dictionary.Add(objectName, value);
62 /// <para>[To be supplied.]</para>
64 public bool Contains(string counterName) {
65 if (counterName == null)
66 throw new ArgumentNullException("counterName");
68 object objectName = counterName.ToLower(CultureInfo.InvariantCulture);
69 return Dictionary.Contains(objectName);
73 /// <para>[To be supplied.]</para>
75 public void CopyTo(InstanceDataCollection[] counters, int index) {
76 Dictionary.Values.CopyTo((Array)counters, index);