RhSolutions-AddIn/RhSolutions.AddIn/Tools/ConvertTool.cs

14 lines
467 B
C#

namespace RhSolutions.Tools;
internal class ConvertTool : ReaderWriterTool, ITool
{
public void Execute()
{
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
_reader = _readerFactory.GetReader("Excel");
var products = _reader.ReadProducts(new[] { worksheet });
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}