Fix from Matt Kunze to add the other Process.Start overloads
[mono.git] / mcs / class / System / System.Diagnostics / InstanceDataCollection.cs
1 //
2 // System.Diagnostics.InstanceDataCollection.cs
3 //
4 // Authors:
5 //   Jonathan Pryor (jonpryor@vt.edu)
6 //
7 // (C) 2002
8 //
9
10 using System;
11 using System.Collections;
12 using System.Diagnostics;
13
14 namespace System.Diagnostics {
15
16         public class InstanceDataCollection : DictionaryBase {
17
18                 private string counterName;
19
20                 private static void CheckNull (object value, string name)
21                 {
22                         if (value == null)
23                                 throw new ArgumentNullException (name);
24                 }
25
26                 // may throw ArgumentNullException
27                 public InstanceDataCollection (string counterName)
28                 {
29                         CheckNull (counterName, "counterName");
30                         this.counterName = counterName;
31                 }
32
33                 public string CounterName {
34                         get {return counterName;}
35                 }
36
37                 // may throw ArgumentNullException
38                 public InstanceData this [string instanceName] {
39                         get {
40                                 CheckNull (instanceName, "instanceName");
41                                 return (InstanceData) Dictionary [instanceName];
42                         }
43                 }
44
45                 public ICollection Keys {
46                         get {return Dictionary.Keys;}
47                 }
48
49                 public ICollection Values {
50                         get {return Dictionary.Values;}
51                 }
52
53                 // may throw ArgumentNullException
54                 public bool Contains (string instanceName)
55                 {
56                         CheckNull (instanceName, "instanceName");
57                         return Dictionary.Contains (instanceName);
58                 }
59
60                 public void CopyTo (InstanceData[] instances, int index)
61                 {
62                         Dictionary.CopyTo (instances, index);
63                 }
64         }
65 }
66