RhSolutions-AddIn/RhSolutions.AddIn/Tools/ExportTool.cs
2023-05-22 07:39:48 +03:00

27 lines
596 B
C#

using RhSolutions.AddIn;
#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");
var products = _reader.ReadProducts(app.Selection);
_writer = _writerFactory.GetWriter("Excel");
_writer.WriteProducts(products);
}
}