4b64d80e6ce78f4f5b454967f19773f34e97d746
[mono.git] / mcs / class / System / System.Diagnostics / TraceSwitch.cs
1 //
2 // System.Diagnostics.TraceSwtich.cs
3 //
4 // Author:
5 //      John R. Hicks (angryjohn69@nc.rr.com)
6 //
7 // (C) 2001
8 //
9
10 namespace System.Diagnostics
11 {
12         /// <summary>
13         /// Multi-level switch to provide tracing and debug output without
14         /// recompiling.
15         /// </summary>
16         public class TraceSwitch : Switch
17         {
18                 private TraceLevel level;
19                 private bool traceError = false;
20                 private bool traceInfo = false;
21                 private bool traceVerbose = false;
22                 private bool traceWarning = false;
23
24                 /// <summary>
25                 /// Initializes a new instance
26                 /// </summary>
27                 /// <param name="displayName">Name for the switch</param>
28                 /// <param name="description">Description of the switch</param>
29                 public TraceSwitch(string displayName, string description)
30                         : base(displayName, description)
31                 {
32                 }
33
34                 /// <summary>
35                 /// Gets or sets the trace level that specifies the messages to 
36                 /// output for tracing and debugging.
37                 /// </summary>
38                 public TraceLevel Level
39                 {
40                         get 
41                         {
42                                 return level;
43                         }
44                         set
45                         {
46                                 level = value;
47                         }
48
49                 }
50
51                 /// <summary>
52                 /// Gets a value indicating whether the Level is set to Error, 
53                 /// Warning, Info, or Verbose.
54                 /// </summary>
55                 public bool TraceError
56                 {
57                         get 
58                         {
59                                 return traceError;
60                         }
61                 }
62
63                 /// <summary>
64                 /// Gets a value indicating whether the Level is set to Info or Verbose.
65                 /// </summary>
66                 public bool TraceInfo
67                 {
68                         get 
69                         {
70                                 return traceInfo;
71                         }
72                 }
73
74                 /// <summary>
75                 /// Gets a value indicating whether the Level is set to Verbose.
76                 /// </summary>
77                 public bool TraceVerbose
78                 {
79                         get 
80                         {
81                                 return traceVerbose;
82                         }
83                 }
84
85                 /// <summary>
86                 /// Gets a value indicating whether the Level is set to
87                 /// Warning, Info, or Verbose.
88                 /// </summary>
89                 public bool TraceWarning
90                 {
91                         get
92                         {
93                                 return traceWarning;
94                         }
95                 }
96         }
97 }