26 lines
639 B
C#
26 lines
639 B
C#
#if !NET472
|
|
using System.Runtime.Versioning;
|
|
#endif
|
|
|
|
namespace RhSolutions.Tools;
|
|
|
|
#if !NET472
|
|
[SupportedOSPlatform("windows")]
|
|
#endif
|
|
internal class MergeTool : Tool
|
|
{
|
|
public MergeTool(IServiceProvider provider) : base(provider)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
IFileDialog dialog = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IFileDialog>();
|
|
string[] files = dialog.GetFiles();
|
|
_reader = _readerFactory.GetReader("Excel");
|
|
var products = _reader.ReadProducts(files);
|
|
_writer = _writerFactory.GetWriter("Excel");
|
|
_writer.WriteProducts(products);
|
|
}
|
|
}
|