RhSolutions-AddIn/RhSolutions.AddIn/Tools/Tool.cs
2023-06-20 11:51:52 +03:00

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();
}