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 ();
69 public string CategoryHelp {
75 throw new ArgumentNullException ("value");
77 _categoryHelp = value;
82 [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
83 public string CategoryName {
89 throw new ArgumentNullException ("value");
91 _categoryName = value;
95 [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
96 public CounterCreationDataCollection Counters {
102 [DefaultValue (UninstallAction.Remove)]
103 public UninstallAction UninstallAction {
105 return _uninstallAction;
108 if (!Enum.IsDefined(typeof(UninstallAction), value))
109 // LAMESPEC, the docs do not mention this, but
110 // this exception is indeed thrown for invalid
112 throw new InvalidEnumArgumentException("value",
113 (int) value, typeof(UninstallAction));
115 _uninstallAction = value;
120 [DefaultValue (PerformanceCounterCategoryType.Unknown)]
121 public PerformanceCounterCategoryType CategoryType {
123 return _categoryType;
126 if (!Enum.IsDefined(typeof(PerformanceCounterCategoryType), value))
127 // LAMESPEC, the docs do not mention this, but
128 // this exception is indeed thrown for invalid
130 throw new InvalidEnumArgumentException("value",
131 (int) value, typeof(PerformanceCounterCategoryType));
133 _categoryType = value;
137 private string _categoryHelp = string.Empty;
138 private string _categoryName = string.Empty;
139 private CounterCreationDataCollection _counters = new CounterCreationDataCollection ();
140 private UninstallAction _uninstallAction = UninstallAction.Remove;
141 private PerformanceCounterCategoryType _categoryType;