31 lines
533 B
C#
31 lines
533 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DotnetStreams
|
|
{
|
|
public class AnonOutputTarget : IOutputTarget
|
|
{
|
|
private readonly Action<string> outputProc;
|
|
public AnonOutputTarget(Action<string> outputProc)
|
|
{
|
|
this.outputProc = outputProc;
|
|
}
|
|
|
|
public virtual void Close()
|
|
{
|
|
}
|
|
|
|
public virtual void Open()
|
|
{
|
|
}
|
|
|
|
public virtual void Output(string line)
|
|
{
|
|
this.outputProc?.Invoke(line);
|
|
}
|
|
}
|
|
}
|