mscorlib(4.0.0.0) API with additions
Debug.cs
3 
4 namespace System.Diagnostics
5 {
7  [global::__DynamicallyInvokable]
8  public static class Debug
9  {
13  {
14  [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
15  [HostProtection(SecurityAction.LinkDemand, SharedState = true)]
16  get
17  {
18  return TraceInternal.Listeners;
19  }
20  }
21 
25  public static bool AutoFlush
26  {
27  [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
28  get
29  {
30  return TraceInternal.AutoFlush;
31  }
32  [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
33  set
34  {
35  TraceInternal.AutoFlush = value;
36  }
37  }
38 
41  public static int IndentLevel
42  {
43  get
44  {
45  return TraceInternal.IndentLevel;
46  }
47  set
48  {
49  TraceInternal.IndentLevel = value;
50  }
51  }
52 
55  public static int IndentSize
56  {
57  get
58  {
59  return TraceInternal.IndentSize;
60  }
61  set
62  {
63  TraceInternal.IndentSize = value;
64  }
65  }
66 
68  [Conditional("DEBUG")]
69  public static void Flush()
70  {
71  TraceInternal.Flush();
72  }
73 
75  [Conditional("DEBUG")]
76  [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
77  public static void Close()
78  {
79  TraceInternal.Close();
80  }
81 
84  [Conditional("DEBUG")]
85  [global::__DynamicallyInvokable]
86  public static void Assert(bool condition)
87  {
88  TraceInternal.Assert(condition);
89  }
90 
94  [Conditional("DEBUG")]
95  [global::__DynamicallyInvokable]
96  public static void Assert(bool condition, string message)
97  {
98  TraceInternal.Assert(condition, message);
99  }
100 
105  [Conditional("DEBUG")]
106  [global::__DynamicallyInvokable]
107  public static void Assert(bool condition, string message, string detailMessage)
108  {
109  TraceInternal.Assert(condition, message, detailMessage);
110  }
111 
117  [Conditional("DEBUG")]
118  [global::__DynamicallyInvokable]
119  public static void Assert(bool condition, string message, string detailMessageFormat, params object[] args)
120  {
121  TraceInternal.Assert(condition, message, string.Format(CultureInfo.InvariantCulture, detailMessageFormat, args));
122  }
123 
126  [Conditional("DEBUG")]
127  [global::__DynamicallyInvokable]
128  public static void Fail(string message)
129  {
130  TraceInternal.Fail(message);
131  }
132 
136  [Conditional("DEBUG")]
137  [global::__DynamicallyInvokable]
138  public static void Fail(string message, string detailMessage)
139  {
140  TraceInternal.Fail(message, detailMessage);
141  }
142 
145  [Conditional("DEBUG")]
146  public static void Print(string message)
147  {
148  TraceInternal.WriteLine(message);
149  }
150 
158  [Conditional("DEBUG")]
159  public static void Print(string format, params object[] args)
160  {
161  TraceInternal.WriteLine(string.Format(CultureInfo.InvariantCulture, format, args));
162  }
163 
166  [Conditional("DEBUG")]
167  [global::__DynamicallyInvokable]
168  public static void Write(string message)
169  {
170  TraceInternal.Write(message);
171  }
172 
175  [Conditional("DEBUG")]
176  [global::__DynamicallyInvokable]
177  public static void Write(object value)
178  {
179  TraceInternal.Write(value);
180  }
181 
185  [Conditional("DEBUG")]
186  [global::__DynamicallyInvokable]
187  public static void Write(string message, string category)
188  {
189  TraceInternal.Write(message, category);
190  }
191 
195  [Conditional("DEBUG")]
196  [global::__DynamicallyInvokable]
197  public static void Write(object value, string category)
198  {
199  TraceInternal.Write(value, category);
200  }
201 
204  [Conditional("DEBUG")]
205  [global::__DynamicallyInvokable]
206  public static void WriteLine(string message)
207  {
208  TraceInternal.WriteLine(message);
209  }
210 
213  [Conditional("DEBUG")]
214  [global::__DynamicallyInvokable]
215  public static void WriteLine(object value)
216  {
217  TraceInternal.WriteLine(value);
218  }
219 
223  [Conditional("DEBUG")]
224  [global::__DynamicallyInvokable]
225  public static void WriteLine(string message, string category)
226  {
227  TraceInternal.WriteLine(message, category);
228  }
229 
233  [Conditional("DEBUG")]
234  [global::__DynamicallyInvokable]
235  public static void WriteLine(object value, string category)
236  {
237  TraceInternal.WriteLine(value, category);
238  }
239 
243  [Conditional("DEBUG")]
244  [global::__DynamicallyInvokable]
245  public static void WriteLine(string format, params object[] args)
246  {
247  TraceInternal.WriteLine(string.Format(CultureInfo.InvariantCulture, format, args));
248  }
249 
253  [Conditional("DEBUG")]
254  [global::__DynamicallyInvokable]
255  public static void WriteIf(bool condition, string message)
256  {
257  TraceInternal.WriteIf(condition, message);
258  }
259 
263  [Conditional("DEBUG")]
264  [global::__DynamicallyInvokable]
265  public static void WriteIf(bool condition, object value)
266  {
267  TraceInternal.WriteIf(condition, value);
268  }
269 
274  [Conditional("DEBUG")]
275  [global::__DynamicallyInvokable]
276  public static void WriteIf(bool condition, string message, string category)
277  {
278  TraceInternal.WriteIf(condition, message, category);
279  }
280 
285  [Conditional("DEBUG")]
286  [global::__DynamicallyInvokable]
287  public static void WriteIf(bool condition, object value, string category)
288  {
289  TraceInternal.WriteIf(condition, value, category);
290  }
291 
295  [Conditional("DEBUG")]
296  [global::__DynamicallyInvokable]
297  public static void WriteLineIf(bool condition, string message)
298  {
299  TraceInternal.WriteLineIf(condition, message);
300  }
301 
305  [Conditional("DEBUG")]
306  [global::__DynamicallyInvokable]
307  public static void WriteLineIf(bool condition, object value)
308  {
309  TraceInternal.WriteLineIf(condition, value);
310  }
311 
317  [Conditional("DEBUG")]
318  [global::__DynamicallyInvokable]
319  public static void WriteLineIf(bool condition, string message, string category)
320  {
321  TraceInternal.WriteLineIf(condition, message, category);
322  }
323 
328  [Conditional("DEBUG")]
329  [global::__DynamicallyInvokable]
330  public static void WriteLineIf(bool condition, object value, string category)
331  {
332  TraceInternal.WriteLineIf(condition, value, category);
333  }
334 
336  [Conditional("DEBUG")]
337  public static void Indent()
338  {
339  TraceInternal.Indent();
340  }
341 
343  [Conditional("DEBUG")]
344  public static void Unindent()
345  {
346  TraceInternal.Unindent();
347  }
348  }
349 }
Provides a thread-safe list of T:System.Diagnostics.TraceListener objects.
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
Describes a set of security permissions applied to code. This class cannot be inherited.
static void Assert(bool condition, string message, string detailMessageFormat, params object[] args)
Checks for a condition; if the condition is false, outputs two messages (simple and formatted) and di...
Definition: Debug.cs:119
static void WriteIf(bool condition, object value, string category)
Writes a category name and the value of the object's M:System.Object.ToString method to the trace lis...
Definition: Debug.cs:287
static void WriteLine(string message, string category)
Writes a category name and message to the trace listeners in the P:System.Diagnostics....
Definition: Debug.cs:225
Exposes state that might be shared between threads.
static void Fail(string message)
Emits the specified error message.
Definition: Debug.cs:128
Definition: __Canon.cs:3
static void Assert(bool condition, string message)
Checks for a condition; if the condition is false, outputs a specified message and displays a message...
Definition: Debug.cs:96
static void WriteLine(string format, params object[] args)
Writes a formatted message followed by a line terminator to the trace listeners in the P:System....
Definition: Debug.cs:245
static void WriteLine(string message)
Writes a message followed by a line terminator to the trace listeners in the P:System....
Definition: Debug.cs:206
static void Flush()
Flushes the output buffer and causes buffered data to write to the P:System.Diagnostics....
Definition: Debug.cs:69
static void Write(object value)
Writes the value of the object's M:System.Object.ToString method to the trace listeners in the P:Syst...
Definition: Debug.cs:177
static void Write(string message)
Writes a message to the trace listeners in the P:System.Diagnostics.Debug.Listeners collection.
Definition: Debug.cs:168
static void WriteLineIf(bool condition, string message)
Writes a message to the trace listeners in the P:System.Diagnostics.Debug.Listeners collection if a c...
Definition: Debug.cs:297
static int IndentLevel
Gets or sets the indent level.
Definition: Debug.cs:42
static void WriteLineIf(bool condition, string message, string category)
Writes a category name and message to the trace listeners in the P:System.Diagnostics....
Definition: Debug.cs:319
SecurityAction
Specifies the security actions that can be performed using declarative security.
static void Close()
Flushes the output buffer and then calls the Close method on each of the P:System....
Definition: Debug.cs:77
static void Unindent()
Decreases the current P:System.Diagnostics.Debug.IndentLevel by one.
Definition: Debug.cs:344
static int IndentSize
Gets or sets the number of spaces in an indent.
Definition: Debug.cs:56
static void WriteIf(bool condition, string message)
Writes a message to the trace listeners in the P:System.Diagnostics.Debug.Listeners collection if a c...
Definition: Debug.cs:255
static void WriteLine(object value)
Writes the value of the object's M:System.Object.ToString method to the trace listeners in the P:Syst...
Definition: Debug.cs:215
static void Print(string format, params object[] args)
Writes a formatted string followed by a line terminator to the trace listeners in the P:System....
Definition: Debug.cs:159
static void Indent()
Increases the current P:System.Diagnostics.Debug.IndentLevel by one.
Definition: Debug.cs:337
static bool AutoFlush
Gets or sets a value indicating whether M:System.Diagnostics.Debug.Flush should be called on the P:Sy...
Definition: Debug.cs:26
Provides a set of methods and properties that help debug your code.
Definition: Debug.cs:8
static void Assert(bool condition, string message, string detailMessage)
Checks for a condition; if the condition is false, outputs two specified messages and displays a mess...
Definition: Debug.cs:107
static void Write(object value, string category)
Writes a category name and the value of the object's M:System.Object.ToString method to the trace lis...
Definition: Debug.cs:197
static void WriteLineIf(bool condition, object value, string category)
Writes a category name and the value of the object's M:System.Object.ToString method to the trace lis...
Definition: Debug.cs:330
static void WriteIf(bool condition, object value)
Writes the value of the object's M:System.Object.ToString method to the trace listeners in the P:Syst...
Definition: Debug.cs:265
static void WriteLine(object value, string category)
Writes a category name and the value of the object's M:System.Object.ToString method to the trace lis...
Definition: Debug.cs:235
static void Assert(bool condition)
Checks for a condition; if the condition is false, displays a message box that shows the call stack.
Definition: Debug.cs:86
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
static void Fail(string message, string detailMessage)
Emits an error message and a detailed error message.
Definition: Debug.cs:138
SecurityPermissionFlag
Specifies access flags for the security permission object.
static void Print(string message)
Writes a message followed by a line terminator to the trace listeners in the P:System....
Definition: Debug.cs:146
static void WriteLineIf(bool condition, object value)
Writes the value of the object's M:System.Object.ToString method to the trace listeners in the P:Syst...
Definition: Debug.cs:307
static void Write(string message, string category)
Writes a category name and message to the trace listeners in the P:System.Diagnostics....
Definition: Debug.cs:187
static void WriteIf(bool condition, string message, string category)
Writes a category name and message to the trace listeners in the P:System.Diagnostics....
Definition: Debug.cs:276
static TraceListenerCollection Listeners
Gets the collection of listeners that is monitoring the debug output.
Definition: Debug.cs:13