-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDebugWriter.cs
61 lines (57 loc) · 1.55 KB
/
DebugWriter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
namespace ObjectDumper
{
/// <summary>
/// This class implements <see cref="TextWriter"/> by writing to <see cref="Debug"/>.
/// </summary>
public sealed class DebugWriter : TextWriter
{
/// <summary>
/// Initializes a new instance of the <see cref="DebugWriter"/> class.
/// </summary>
public DebugWriter()
: base(CultureInfo.InvariantCulture)
{
// Do nothing here
}
/// <summary>
/// Returns the <see cref="Encoding"/> in which the output is written.
/// </summary>
/// <returns>
/// The Encoding in which the output is written.
/// </returns>
public override Encoding Encoding
{
get
{
return Encoding.Default;
}
}
/// <summary>
/// Writes a character to the text stream.
/// </summary>
/// <param name="value">
/// The character to write to the text stream.
/// </param>
public override void Write(char value)
{
Debug.Write(value);
}
/// <summary>
/// Writes a string to the text stream.
/// </summary>
/// <param name="value">
/// The string to write.
/// </param>
public override void Write(string value)
{
Debug.Write(value);
}
}
}