24 lines
585 B
C#
24 lines
585 B
C#
#if !NET472
|
|
using System.Runtime.Versioning;
|
|
#endif
|
|
|
|
namespace RhSolutions.Tools;
|
|
|
|
internal class MagicTool : Tool
|
|
{
|
|
public MagicTool(IServiceProvider provider) : base(provider)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
Application app = RhSolutionsAddIn.Excel.Application;
|
|
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
|
_reader = _readerFactory.GetReader("Magic");
|
|
var products = _reader.ReadProducts(new[] { worksheet });
|
|
_writer = _writerFactory.GetWriter("Excel");
|
|
_writer.WriteProducts(products);
|
|
}
|
|
}
|
|
|