PerformanceCounterCategory.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. //
  2. // System.Diagnostics.PerformanceCounterCategory.cs
  3. //
  4. // Authors:
  5. // Jonathan Pryor ([email protected])
  6. //
  7. // (C) 2002
  8. //
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. using System;
  30. using System.Diagnostics;
  31. namespace System.Diagnostics
  32. {
  33. public sealed class PerformanceCounterCategory
  34. {
  35. private string categoryName;
  36. private string machineName;
  37. public PerformanceCounterCategory ()
  38. : this ("", ".")
  39. {
  40. }
  41. // may throw ArgumentException (""), ArgumentNullException
  42. public PerformanceCounterCategory (string categoryName)
  43. : this (categoryName, ".")
  44. {
  45. }
  46. // may throw ArgumentException (""), ArgumentNullException
  47. [MonoTODO]
  48. public PerformanceCounterCategory (string categoryName,
  49. string machineName)
  50. {
  51. // TODO checks and whatever else is needed
  52. this.categoryName = categoryName;
  53. this.machineName = machineName;
  54. throw new NotImplementedException ();
  55. }
  56. // may throw InvalidOperationException, Win32Exception
  57. [MonoTODO]
  58. public string CategoryHelp {
  59. get {throw new NotImplementedException ();}
  60. }
  61. // may throw ArgumentException (""), ArgumentNullException
  62. [MonoTODO]
  63. public string CategoryName {
  64. get {return categoryName;}
  65. set {
  66. // TODO needs validity checks
  67. categoryName = value;
  68. }
  69. }
  70. // may throw ArgumentException
  71. [MonoTODO]
  72. public string MachineName {
  73. get {return machineName;}
  74. set {
  75. // TODO needs validity checks
  76. machineName = value;
  77. }
  78. }
  79. // may throw ArgumentNullException, InvalidOperationException
  80. // (categoryName isn't set), Win32Exception
  81. [MonoTODO]
  82. public bool CounterExists (string counterName)
  83. {
  84. throw new NotImplementedException ();
  85. }
  86. // may throw ArgumentNullException, InvalidOperationException
  87. // (categoryName is ""), Win32Exception
  88. [MonoTODO]
  89. public static bool CounterExists (string counterName,
  90. string categoryName)
  91. {
  92. throw new NotImplementedException ();
  93. }
  94. // may throw ArgumentNullException, InvalidOperationException
  95. // (categoryName is "", machine name is bad), Win32Exception
  96. [MonoTODO]
  97. public static bool CounterExists (string counterName,
  98. string categoryName,
  99. string machineName)
  100. {
  101. throw new NotImplementedException ();
  102. }
  103. [MonoTODO]
  104. public static PerformanceCounterCategory Create (
  105. string categoryName,
  106. string categoryHelp,
  107. CounterCreationDataCollection counterData)
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. [MonoTODO]
  112. public static PerformanceCounterCategory Create (
  113. string categoryName,
  114. string categoryHelp,
  115. string counterName,
  116. string counterHelp)
  117. {
  118. throw new NotImplementedException ();
  119. }
  120. [MonoTODO]
  121. public static void Delete (string categoryName)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. [MonoTODO]
  126. public static bool Exists (string categoryName)
  127. {
  128. throw new NotImplementedException ();
  129. }
  130. [MonoTODO]
  131. public static bool Exists (string categoryName,
  132. string machineName)
  133. {
  134. throw new NotImplementedException ();
  135. }
  136. [MonoTODO]
  137. public static PerformanceCounterCategory[] GetCategories ()
  138. {
  139. throw new NotImplementedException ();
  140. }
  141. [MonoTODO]
  142. public static PerformanceCounterCategory[] GetCategories (
  143. string machineName)
  144. {
  145. throw new NotImplementedException ();
  146. }
  147. [MonoTODO]
  148. public PerformanceCounter[] GetCounters ()
  149. {
  150. throw new NotImplementedException ();
  151. }
  152. [MonoTODO]
  153. public PerformanceCounter[] GetCounters (string instanceName)
  154. {
  155. throw new NotImplementedException ();
  156. }
  157. [MonoTODO]
  158. public string[] GetInstanceNames ()
  159. {
  160. throw new NotImplementedException ();
  161. }
  162. [MonoTODO]
  163. public bool InstanceExists (string instanceName)
  164. {
  165. throw new NotImplementedException ();
  166. }
  167. [MonoTODO]
  168. public static bool InstanceExists (string instanceName,
  169. string categoryName)
  170. {
  171. throw new NotImplementedException ();
  172. }
  173. [MonoTODO]
  174. public static bool InstanceExists (string instanceName,
  175. string categoryName,
  176. string machineName)
  177. {
  178. throw new NotImplementedException ();
  179. }
  180. [MonoTODO]
  181. public InstanceDataCollectionCollection ReadCategory ()
  182. {
  183. throw new NotImplementedException ();
  184. }
  185. }
  186. }