[HttpWebRequest] EndGetResponse already does this.
[mono.git] / mcs / class / System.Configuration.Install / System.Diagnostics / PerformanceCounterInstaller.cs
1 // System.Diagnostics.PerformanceCounterInstaller.cs
2 //
3 // Author:
4 //      Gert Driesen (drieseng@users.sourceforge.net)
5 //
6 // (C) Gert Driesen
7 // (C) Novell
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Configuration.Install;
34 using System.Runtime.InteropServices;
35
36 namespace System.Diagnostics
37 {
38         public class PerformanceCounterInstaller : ComponentInstaller
39         {
40                 public PerformanceCounterInstaller ()
41                 {
42                 }
43
44                 [MonoTODO]
45                 public override void CopyFromComponent (IComponent component)
46                 {
47                         throw new NotImplementedException ();
48                 }
49
50                 [MonoTODO]
51                 public override void Install (IDictionary stateSaver)
52                 {
53                         throw new NotImplementedException ();
54                 }
55
56                 [MonoTODO]
57                 public override void Rollback (IDictionary savedState)
58                 {
59                         throw new NotImplementedException ();
60                 }
61
62                 [MonoTODO]
63                 public override void Uninstall (IDictionary savedState)
64                 {
65                         throw new NotImplementedException ();
66                 }
67
68                 [DefaultValue ("")]
69 #if !NET_2_0
70                 [MonitoringDescription ("PCI_CategoryHelp")]
71 #endif
72                 public string CategoryHelp {
73                         get {
74                                 return _categoryHelp;
75                         }
76                         set {
77                                 if (value == null)
78                                         throw new ArgumentNullException ("value");
79
80                                 _categoryHelp = value;
81                         }
82                 }
83
84                 [DefaultValue ("")]
85                 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
86                 public string CategoryName {
87                         get {
88                                 return _categoryName;
89                         }
90                         set {
91                                 if (value == null)
92                                         throw new ArgumentNullException ("value");
93
94                                 _categoryName = value;
95                         }
96                 }
97
98                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
99 #if !NET_2_0
100                 [MonitoringDescription("PCI_Counters")]
101 #endif
102                 public CounterCreationDataCollection Counters {
103                         get {
104                                 return _counters;
105                         }
106                 }
107
108                 [DefaultValue (UninstallAction.Remove)]
109 #if !NET_2_0
110                 [MonitoringDescription ("PCI_UninstallAction")]
111 #endif
112                 public UninstallAction UninstallAction {
113                         get {
114                                 return _uninstallAction;
115                         }
116                         set {
117                                 if (!Enum.IsDefined(typeof(UninstallAction), value))
118                                         // LAMESPEC, the docs do not mention this, but 
119                                         // this exception is indeed thrown for invalid
120                                         // values
121                                         throw new InvalidEnumArgumentException("value", 
122                                                 (int) value, typeof(UninstallAction));
123
124                                 _uninstallAction = value;
125                         }
126                 }
127
128 #if NET_2_0
129                 [ComVisible (false)]
130                 [DefaultValue (PerformanceCounterCategoryType.Unknown)]
131                 public PerformanceCounterCategoryType CategoryType {
132                         get {
133                                 return _categoryType;
134                         }
135                         set {
136                                 if (!Enum.IsDefined(typeof(PerformanceCounterCategoryType), value))
137                                         // LAMESPEC, the docs do not mention this, but 
138                                         // this exception is indeed thrown for invalid
139                                         // values
140                                         throw new InvalidEnumArgumentException("value", 
141                                                 (int) value, typeof(PerformanceCounterCategoryType));
142
143                                 _categoryType = value;
144                         }
145                 }
146 #endif
147
148                 private string _categoryHelp = string.Empty;
149                 private string _categoryName = string.Empty;
150                 private CounterCreationDataCollection _counters = new CounterCreationDataCollection ();
151                 private UninstallAction _uninstallAction = UninstallAction.Remove;
152 #if NET_2_0
153                 private PerformanceCounterCategoryType _categoryType;
154 #endif
155         }
156 }