EventSourceCreationData.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. //
  2. // System.Diagnostics.EventSourceCreationData
  3. //
  4. // Author:
  5. // Gert Driesen <[email protected]>
  6. //
  7. // Copyright (C) 2006 Novell, Inc (http://www.novell.com)
  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. namespace System.Diagnostics
  30. {
  31. #if NET_2_0
  32. public
  33. #else
  34. internal
  35. #endif
  36. class EventSourceCreationData
  37. {
  38. string _source;
  39. string _logName;
  40. string _machineName;
  41. string _messageResourceFile;
  42. string _parameterResourceFile;
  43. string _categoryResourceFile;
  44. int _categoryCount;
  45. public EventSourceCreationData (string source, string logName)
  46. {
  47. _source = source;
  48. _logName = logName;
  49. _machineName = ".";
  50. }
  51. internal EventSourceCreationData (string source, string logName, string machineName)
  52. {
  53. _source = source;
  54. if (logName == null || logName.Length == 0) {
  55. _logName = "Application";
  56. } else {
  57. _logName = logName;
  58. }
  59. _machineName = machineName;
  60. }
  61. public int CategoryCount
  62. {
  63. get { return _categoryCount; }
  64. set {
  65. if (value < 0)
  66. throw new ArgumentOutOfRangeException ("value");
  67. _categoryCount = value;
  68. }
  69. }
  70. public string CategoryResourceFile
  71. {
  72. get { return _categoryResourceFile; }
  73. set { this._categoryResourceFile = value; }
  74. }
  75. public string LogName
  76. {
  77. get { return _logName; }
  78. set { this._logName = value; }
  79. }
  80. public string MachineName
  81. {
  82. get { return _machineName; }
  83. set { _machineName = value; }
  84. }
  85. public string MessageResourceFile
  86. {
  87. get { return _messageResourceFile; }
  88. set { _messageResourceFile = value; }
  89. }
  90. public string ParameterResourceFile
  91. {
  92. get { return _parameterResourceFile; }
  93. set { _parameterResourceFile = value; }
  94. }
  95. public string Source
  96. {
  97. get { return _source; }
  98. set { _source = value; }
  99. }
  100. }
  101. }