morpionReseau/go01/TextBoxStreamWriter.cs

30 lines
659 B
C#
Raw Normal View History

2018-12-14 14:08:07 +01:00
using System;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace go01
{
public class TextBoxStreamWriter : TextWriter
{
RichTextBox _output = null;
public TextBoxStreamWriter(RichTextBox output)
{
_output = output;
}
public override void Write(char value)
{
base.Write(value);
_output.AppendText(value.ToString().Replace('\n', ' '));
}
public override Encoding Encoding
{
get { return System.Text.Encoding.UTF8; }
}
}
}