RhSolutions-AddIn/RhSolutions.AddIn/Tools/MergeTool.cs

18 lines
460 B
C#
Raw Permalink Normal View History

2024-11-09 22:59:46 +03:00
namespace RhSolutions.Tools;
2023-04-06 08:29:39 +03:00
2024-11-09 22:59:46 +03:00
internal class MergeTool : ReaderWriterTool, ITool
2023-04-06 08:29:39 +03:00
{
2024-11-09 22:59:46 +03:00
public void Execute()
{
IFileDialog dialog = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IFileDialog>();
string[] files = dialog.GetFiles();
if (files.Length > 0)
{
_reader = _readerFactory.GetReader("Excel");
var products = _reader.ReadProducts(files);
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}
2023-04-06 08:29:39 +03:00
}