2003-07-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
[mono.git] / mcs / class / System / System.Diagnostics / CounterCreationData.cs
1 //
2 // System.Diagnostics.CounterCreationData.cs
3 //
4 // Authors:
5 //   Jonathan Pryor (jonpryor@vt.edu)
6 //   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 //
8 // (C) 2002
9 // (C) 2003 Andreas Nahr
10 //
11
12 using System;
13 using System.ComponentModel;
14
15 namespace System.Diagnostics {
16
17         [Serializable]
18         [TypeConverter ("System.Diagnostics.Design.CounterCreationDataConverter, " + Consts.AssemblySystem_Design)]
19         public class CounterCreationData 
20         {
21
22                 private string help;
23                 private string name;
24                 private PerformanceCounterType type;
25
26                 public CounterCreationData ()
27                 {
28                 }
29
30                 public CounterCreationData (string counterName, 
31                         string counterHelp, 
32                         PerformanceCounterType counterType)
33                 {
34                         name = counterName;
35                         help = counterHelp;
36                         type = counterType;
37                 }
38
39                 [DefaultValue ("")]
40                 [MonitoringDescription ("Description of this counter.")]
41                 public string CounterHelp {
42                         get {return help;}
43                         set {help = value;}
44                 }
45
46                 [DefaultValue ("")]
47                 [MonitoringDescription ("Name of this counter.")]
48                 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
49                 public string CounterName 
50                 {
51                         get {return name;}
52                         set {name = value;}
53                 }
54
55                 // may throw InvalidEnumArgumentException
56                 [DefaultValue (typeof (PerformanceCounterType), "NumberOfItems32")]
57                 [MonitoringDescription ("Type of this counter.")]
58                 public PerformanceCounterType CounterType {
59                         get {return type;}
60                         set {type = value;}
61                 }
62         }
63 }
64