From 01cdb458d725efdad3276fc2d8aee0a63de16bc7 Mon Sep 17 00:00:00 2001 From: Lior Banai Date: Sat, 22 Jul 2023 20:42:57 +0300 Subject: [PATCH] Revert #1708 fix #1782 --- Analogy/Forms/FluentDesignMainForm.cs | 23 ++++++++++++----------- Analogy/Forms/MainForm.cs | 9 +++++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Analogy/Forms/FluentDesignMainForm.cs b/Analogy/Forms/FluentDesignMainForm.cs index 99fd9c01..1a211c04 100644 --- a/Analogy/Forms/FluentDesignMainForm.cs +++ b/Analogy/Forms/FluentDesignMainForm.cs @@ -95,7 +95,8 @@ private async void FluentDesignMainForm_Load(object sender, EventArgs e) foreach (FactoryContainer fc in FactoriesManager.Instance.Factories .Where(factory => !FactoriesManager.Instance.IsBuiltInFactory(factory.Factory) && factory.FactorySetting.Status != DataProviderFactoryStatus.Disabled - && factory.DataProvidersFactories.Any(d => d.DataProviders.Any()))) + //&& factory.DataProvidersFactories.Any(d => d.DataProviders.Any()) + )) { CreateDataSourceMenuItem(fc); } @@ -147,7 +148,7 @@ private async void FluentDesignMainForm_Load(object sender, EventArgs e) if (settings.ShowWhatIsNewAtStartup) { - //settings.ShowWhatIsNewAtStartup = false; + //settings.ShowWhatIsNewAtStartup = false; } } @@ -339,7 +340,7 @@ private async Task OpenOfflineLogs(string[] fileNames, IAnalogyOfflineDataProvid { openedWindows++; await FactoriesManager.Instance.InitializeIfNeeded(dataProvider); - string fullTitle = $"{offlineTitle} #{openedWindows}{(title == null ? "" : $" ({title})")}"; + string fullTitle = $"{offlineTitle} #{openedWindows}{(title == null ? "" : $" ({title})")}"; UserControl offlineUC = new LocalLogFilesUC(dataProvider, fileNames, title: fullTitle); var page = dockManager1.AddPanel(DockingStyle.Float); page.DockedAsTabbedDocument = true; @@ -458,7 +459,7 @@ private void SetupEventHandlers() { ApplicationSettingsForm user = new ApplicationSettingsForm(ApplicationSettingsSelectionType.DataProvidersSettings); user.ShowDialog(this); - }; + }; bbiRealTimeProviders.ItemClick += (s, e) => { ApplicationSettingsForm user = new ApplicationSettingsForm(ApplicationSettingsSelectionType.RealTimeDataProvidersSettings); @@ -527,7 +528,7 @@ private void SetupEventHandlers() var change = new ChangeLog(); change.ShowDialog(this); }; - + tmrStatusUpdates.Tick += (s, e) => { tmrStatusUpdates.Stop(); @@ -827,7 +828,7 @@ async Task OpenOffline(string titleOfDataSource, string initialFolder, string[] { openedWindows++; await FactoriesManager.Instance.InitializeIfNeeded(offlineAnalogy); - string fullTitle = $"{offlineTitle} #{openedWindows} ({titleOfDataSource})"; + string fullTitle = $"{offlineTitle} #{openedWindows} ({titleOfDataSource})"; UserControl offlineUC = new LocalLogFilesUC(offlineAnalogy, files, initialFolder, title: fullTitle); var page = dockManager1.AddPanel(DockingStyle.Float); page.DockedAsTabbedDocument = true; @@ -849,7 +850,7 @@ void OpenExternalDataSource(string titleOfDataSource, IAnalogyOfflineDataProvide dockManager1.ActivePanel = page; } - async Task OpenFilePooling(string titleOfDataSource, string initialFolder, string file, string initialFile) + async Task OpenFilePooling(string titleOfDataSource, string initialFolder, string file, string initialFile) { openedWindows++; await FactoriesManager.Instance.InitializeIfNeeded(offlineAnalogy); @@ -1107,7 +1108,7 @@ private void AddRecentFolder(AccordionControlElement recentElement, IAnalogyOffl btn.Click += (s, be) => { openedWindows++; - string fullTitle = $"{offlineTitle} #{openedWindows} ({title})"; + string fullTitle = $"{offlineTitle} #{openedWindows} ({title})"; UserControl offlineUC = new LocalLogFilesUC(offlineAnalogy, null, recentPath, title: fullTitle); var page = dockManager1.AddPanel(DockingStyle.Float); page.DockedAsTabbedDocument = true; @@ -1126,7 +1127,7 @@ private void AddRecentFiles(AccordionControlElement recentElement, IAnalogyOffli foreach (string file in recentFiles) { - if (!File.Exists(file) || recentElement.Elements.Any(e=>e.Text.Equals(Path.GetFileName(file)))) + if (!File.Exists(file) || recentElement.Elements.Any(e => e.Text.Equals(Path.GetFileName(file)))) { continue; } @@ -1341,12 +1342,12 @@ private void AddSingleDataSources(FactoryContainer fc, IAnalogyDataProvidersFact dockManager1.ActivePanel = page; if (single is IAnalogySingleFileDataProvider fileProvider) { - fileProvider.Process(cts.Token, offlineUC.Handler); + await fileProvider.Process(cts.Token, offlineUC.Handler); } if (single is IAnalogySingleDataProvider singleProvider) { - singleProvider.Execute(cts.Token, offlineUC.Handler); + await singleProvider.Execute(cts.Token, offlineUC.Handler); } }; diff --git a/Analogy/Forms/MainForm.cs b/Analogy/Forms/MainForm.cs index c4c641df..2dbc4ada 100644 --- a/Analogy/Forms/MainForm.cs +++ b/Analogy/Forms/MainForm.cs @@ -215,8 +215,9 @@ private async void AnalogyMainForm_Load(object sender, EventArgs e) foreach (FactoryContainer fc in FactoriesManager.Instance.Factories .Where(factory => !FactoriesManager.Instance.IsBuiltInFactory(factory.Factory) && factory.FactorySetting.Status != DataProviderFactoryStatus.Disabled - && (factory.DataProvidersFactories.Any(d => d.DataProviders.Any() - || factory.UserControlsFactories.Any())))) + //&& (factory.DataProvidersFactories.Any(d => d.DataProviders.Any() + //|| factory.UserControlsFactories.Any())) + )) { CreateDataSource(fc, 3); } @@ -1396,12 +1397,12 @@ private void AddSingleDataSources(IAnalogyFactory primaryFactory, RibbonPage rib dockManager1.ActivePanel = page; if (single is IAnalogySingleFileDataProvider fileProvider) { - fileProvider.Process(cts.Token, offlineUC.Handler); + await fileProvider.Process(cts.Token, offlineUC.Handler); } if (single is IAnalogySingleDataProvider singleProvider) { - singleProvider.Execute(cts.Token, offlineUC.Handler); + await singleProvider.Execute(cts.Token, offlineUC.Handler); } };