CounterCreationData.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // System.Diagnostics.CounterCreationData.cs
  3. //
  4. // Authors:
  5. // Jonathan Pryor ([email protected])
  6. // Andreas Nahr ([email protected])
  7. //
  8. // (C) 2002
  9. // (C) 2003 Andreas Nahr
  10. //
  11. using System;
  12. using System.ComponentModel;
  13. namespace System.Diagnostics {
  14. [Serializable]
  15. [TypeConverter ("System.Diagnostics.Design.CounterCreationDataConverter, " + Consts.AssemblySystem_Design)]
  16. public class CounterCreationData
  17. {
  18. private string help;
  19. private string name;
  20. private PerformanceCounterType type;
  21. public CounterCreationData ()
  22. {
  23. }
  24. public CounterCreationData (string counterName,
  25. string counterHelp,
  26. PerformanceCounterType counterType)
  27. {
  28. name = counterName;
  29. help = counterHelp;
  30. type = counterType;
  31. }
  32. [DefaultValue ("")]
  33. [MonitoringDescription ("Description of this counter.")]
  34. public string CounterHelp {
  35. get {return help;}
  36. set {help = value;}
  37. }
  38. [DefaultValue ("")]
  39. [MonitoringDescription ("Name of this counter.")]
  40. [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
  41. public string CounterName
  42. {
  43. get {return name;}
  44. set {name = value;}
  45. }
  46. // may throw InvalidEnumArgumentException
  47. [DefaultValue (typeof (PerformanceCounterType), "NumberOfItems32")]
  48. [MonitoringDescription ("Type of this counter.")]
  49. public PerformanceCounterType CounterType {
  50. get {return type;}
  51. set {type = value;}
  52. }
  53. }
  54. }