Skip to content

Commit

Permalink
Refactor file association to use data provider and not data factory #…
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Sep 15, 2023
1 parent c82cb6b commit c7ac310
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Analogy/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,19 @@ private async Task OpenOfflineFileWithSpecificDataProvider(string[] files)
var associations = Settings.GetDataProvidesForFilesAssociations(files);
if (associations.Any())
{
var parser = FactoriesManager.GetAllOfflineDataSources(associations).ToList();
if (parser.Count == 1)
var parsers = FactoriesManager.GetAllOfflineDataSources(associations).ToList();
if (parsers.Count == 1)
{
RibbonPage? page = Mapping.TryGetValue(parser.First().Id, out RibbonPage? value)
var parser = parsers.First();
var fc = FactoriesManager.GetFactoryContainer(parser.Id);
RibbonPage? page = Mapping.TryGetValue(fc.Factory.FactoryId, out RibbonPage? value)
? value
: null;
await OpenOfflineLogs(page, files, parser.First());
if (page is not null)
{
ribbonControlMain.SelectPage(page);
}
await OpenOfflineLogs(page, files, parser);
}
else
{
Expand Down

0 comments on commit c7ac310

Please sign in to comment.