RhSolutions-AddIn/RhSolutions.AddIn/Tools/Tool.cs
2023-04-17 08:49:26 +03:00

29 lines
638 B
C#

#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.Tools;
#if !NET472
[SupportedOSPlatform("windows")]
#endif
internal abstract class Tool : IDisposable
{
protected readonly IExcelReader _reader;
protected readonly WriterFactory _writerFactory;
protected IExcelWriter _writer;
public Tool(IServiceProvider provider)
{
_reader = provider.GetRequiredService<IExcelReader>();
_writerFactory = provider.GetRequiredService<WriterFactory>();
}
public void Dispose()
{
_reader.Dispose();
_writer.Dispose();
}
public abstract void Execute();
}