using System;
using System.IO;
using System.Text;
using System.Windows.Controls;

namespace QCLVR;

public class ConsoleTextBox : TextWriter
{
	private TextBox textBox;

	public override Encoding Encoding => Encoding.UTF8;

	public ConsoleTextBox(TextBox output)
	{
		textBox = output;
	}

	public override void Write(char value)
	{
		base.Write(value);
		textBox.Dispatcher.BeginInvoke((Action)delegate
		{
			textBox.AppendText(value.ToString());
		});
	}
}
