RhSolutions-AddIn/RhSolutions.AddIn/Tools/MagicTool.cs
2023-05-23 06:54:37 +03:00

24 lines
585 B
C#

#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.Tools;
internal class MagicTool : Tool
{
public MagicTool(IServiceProvider provider) : base(provider)
{
}
public override void Execute()
{
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
_reader = _readerFactory.GetReader("Magic");
var products = _reader.ReadProducts(new[] { worksheet });
_writer = _writerFactory.GetWriter("Excel");
_writer.WriteProducts(products);
}
}