RhSolutions-AddIn/RhSolutions.AddIn/Tools/ToolBase.cs

28 lines
617 B
C#
Raw Normal View History

2023-04-06 08:29:39 +03:00
#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.Tools;
#if !NET472
[SupportedOSPlatform("windows")]
#endif
2023-04-07 07:19:49 +03:00
internal abstract class ToolBase : IDisposable
2023-04-06 08:29:39 +03:00
{
protected readonly IExcelReader _reader;
protected readonly IExcelWriter _writer;
public ToolBase()
{
_reader = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IExcelReader>();
_writer = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IExcelWriter>();
}
2023-04-07 07:19:49 +03:00
public void Dispose()
{
_reader.Dispose();
_writer.Dispose();
}
2023-04-06 08:29:39 +03:00
public abstract void Execute();
}