RhSolutions-AddIn/RhSolutions.AddIn/Tools/ToolBase.cs
2023-04-07 07:19:49 +03:00

28 lines
617 B
C#

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