Get writer before reading
This commit is contained in:
parent
16b5ddedb1
commit
a56300a620
@ -19,8 +19,8 @@ internal class ConvertTool : Tool
|
|||||||
Application app = RhSolutionsAddIn.Excel.Application;
|
Application app = RhSolutionsAddIn.Excel.Application;
|
||||||
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
||||||
_reader = _readerFactory.GetReader("Excel");
|
_reader = _readerFactory.GetReader("Excel");
|
||||||
var products = _reader.ReadProducts(new[] { worksheet });
|
|
||||||
_writer = _writerFactory.GetWriter("Excel");
|
_writer = _writerFactory.GetWriter("Excel");
|
||||||
|
var products = _reader.ReadProducts(new[] { worksheet });
|
||||||
_writer.WriteProducts(products);
|
_writer.WriteProducts(products);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,8 +17,8 @@ internal class ExportTool : Tool
|
|||||||
{
|
{
|
||||||
Application app = RhSolutionsAddIn.Excel.Application;
|
Application app = RhSolutionsAddIn.Excel.Application;
|
||||||
_reader = _readerFactory.GetReader("Excel");
|
_reader = _readerFactory.GetReader("Excel");
|
||||||
var products = _reader.ReadProducts(app.Selection);
|
|
||||||
_writer = _writerFactory.GetWriter("Excel");
|
_writer = _writerFactory.GetWriter("Excel");
|
||||||
|
var products = _reader.ReadProducts(app.Selection);
|
||||||
_writer.WriteProducts(products);
|
_writer.WriteProducts(products);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ internal class GuessTool : Tool
|
|||||||
Application app = RhSolutionsAddIn.Excel.Application;
|
Application app = RhSolutionsAddIn.Excel.Application;
|
||||||
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
|
||||||
_reader = _readerFactory.GetReader("Guess");
|
_reader = _readerFactory.GetReader("Guess");
|
||||||
var products = _reader.ReadProducts(new[] { worksheet });
|
|
||||||
_writer = _writerFactory.GetWriter("Excel");
|
_writer = _writerFactory.GetWriter("Excel");
|
||||||
|
var products = _reader.ReadProducts(new[] { worksheet });
|
||||||
_writer.WriteProducts(products);
|
_writer.WriteProducts(products);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ internal class MergeTool : Tool
|
|||||||
IFileDialog dialog = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IFileDialog>();
|
IFileDialog dialog = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IFileDialog>();
|
||||||
string[] files = dialog.GetFiles();
|
string[] files = dialog.GetFiles();
|
||||||
_reader = _readerFactory.GetReader("Excel");
|
_reader = _readerFactory.GetReader("Excel");
|
||||||
var products = _reader.ReadProducts(files);
|
|
||||||
_writer = _writerFactory.GetWriter("Excel");
|
_writer = _writerFactory.GetWriter("Excel");
|
||||||
|
var products = _reader.ReadProducts(files);
|
||||||
_writer.WriteProducts(products);
|
_writer.WriteProducts(products);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user