RhSolutions-AddIn/RhSolutions.AddIn/Tools/GuessTool.cs

24 lines
588 B
C#
Raw Normal View History

2023-05-23 06:54:37 +03:00
#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.Tools;
2023-05-23 07:07:16 +03:00
internal class GuessTool : Tool
2023-05-23 06:54:37 +03:00
{
2023-05-23 07:07:16 +03:00
public GuessTool(IServiceProvider provider) : base(provider)
2023-05-23 06:54:37 +03:00
{
}
public override void Execute()
{
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
2023-05-23 07:07:16 +03:00
_reader = _readerFactory.GetReader("Guess");
2023-06-20 07:25:44 +03:00
_writer = _writerFactory.GetWriter("NewPrice");
2023-05-23 07:33:40 +03:00
var products = _reader.ReadProducts(new[] { worksheet });
2023-05-23 06:54:37 +03:00
_writer.WriteProducts(products);
}
}