1 // System.Diagnostics.PerformanceCounterInstaller.cs
4 // Gert Driesen (drieseng@users.sourceforge.net)
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Configuration.Install;
34 using System.Runtime.InteropServices;
36 namespace System.Diagnostics
38 public class PerformanceCounterInstaller : ComponentInstaller
40 public PerformanceCounterInstaller ()
45 public override void CopyFromComponent (IComponent component)
47 throw new NotImplementedException ();
51 public override void Install (IDictionary stateSaver)
53 throw new NotImplementedException ();
57 public override void Rollback (IDictionary savedState)
59 throw new NotImplementedException ();
63 public override void Uninstall (IDictionary savedState)
65 throw new NotImplementedException ();
70 [MonitoringDescription ("PCI_CategoryHelp")]
72 public string CategoryHelp {
78 throw new ArgumentNullException ("value");
80 _categoryHelp = value;
85 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
86 public string CategoryName {
92 throw new ArgumentNullException ("value");
94 _categoryName = value;
98 [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
100 [MonitoringDescription("PCI_Counters")]
102 public CounterCreationDataCollection Counters {
108 [DefaultValue (UninstallAction.Remove)]
110 [MonitoringDescription ("PCI_UninstallAction")]
112 public UninstallAction UninstallAction {
114 return _uninstallAction;
117 if (!Enum.IsDefined(typeof(UninstallAction), value))
118 // LAMESPEC, the docs do not mention this, but
119 // this exception is indeed thrown for invalid
121 throw new InvalidEnumArgumentException("value",
122 (int) value, typeof(UninstallAction));
124 _uninstallAction = value;
130 [DefaultValue (PerformanceCounterCategoryType.Unknown)]
131 public PerformanceCounterCategoryType CategoryType {
133 return _categoryType;
136 if (!Enum.IsDefined(typeof(PerformanceCounterCategoryType), value))
137 // LAMESPEC, the docs do not mention this, but
138 // this exception is indeed thrown for invalid
140 throw new InvalidEnumArgumentException("value",
141 (int) value, typeof(PerformanceCounterCategoryType));
143 _categoryType = value;
148 private string _categoryHelp = string.Empty;
149 private string _categoryName = string.Empty;
150 private CounterCreationDataCollection _counters = new CounterCreationDataCollection ();
151 private UninstallAction _uninstallAction = UninstallAction.Remove;
153 private PerformanceCounterCategoryType _categoryType;