30 lines
651 B
C#
30 lines
651 B
C#
#if !NET472
|
|
using System.Runtime.Versioning;
|
|
#endif
|
|
|
|
namespace RhSolutions.Tools;
|
|
|
|
#if !NET472
|
|
[SupportedOSPlatform("windows")]
|
|
#endif
|
|
internal abstract class Tool : IDisposable
|
|
{
|
|
protected readonly ReaderFactory _readerFactory;
|
|
protected readonly WriterFactory _writerFactory;
|
|
protected IReader _reader;
|
|
protected IWriter _writer;
|
|
|
|
public Tool(ReaderFactory readerFactory, WriterFactory writerFactory)
|
|
{
|
|
_readerFactory = readerFactory;
|
|
_writerFactory = writerFactory;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
_reader?.Dispose();
|
|
_writer?.Dispose();
|
|
}
|
|
|
|
public abstract void Execute();
|
|
} |