RhSolutions-AddIn/RhSolutions.AddIn/Tools/ExportTool.cs
2023-06-21 16:30:16 +03:00

26 lines
625 B
C#

#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.Tools;
#if !NET472
[SupportedOSPlatform("windows")]
#endif
internal class ExportTool : Tool
{
public ExportTool(ReaderFactory readerFactory, WriterFactory writerFactory) : base(readerFactory, writerFactory)
{
}
public override void Execute()
{
Application app = RhSolutionsAddIn.Excel.Application;
_reader = _readerFactory.GetReader("Excel");
var products = _reader.ReadProducts(app.Selection);
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}