RhSolutions-AddIn/RhSolutions.AddIn/Tools/ExportTool.cs
2023-06-20 07:25:44 +03:00

26 lines
574 B
C#

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