PerformanceCounterInstaller.cs 3.4 KB

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