Skip to content

Commit

Permalink
Revert #1708 fix #1782
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Jul 22, 2023
1 parent a89a7be commit 01cdb45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
23 changes: 12 additions & 11 deletions Analogy/Forms/FluentDesignMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -147,7 +148,7 @@ private async void FluentDesignMainForm_Load(object sender, EventArgs e)

if (settings.ShowWhatIsNewAtStartup)
{
//settings.ShowWhatIsNewAtStartup = false;
//settings.ShowWhatIsNewAtStartup = false;
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -527,7 +528,7 @@ private void SetupEventHandlers()
var change = new ChangeLog();
change.ShowDialog(this);
};

tmrStatusUpdates.Tick += (s, e) =>
{
tmrStatusUpdates.Stop();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
};
Expand Down
9 changes: 5 additions & 4 deletions Analogy/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
};
Expand Down

0 comments on commit 01cdb45

Please sign in to comment.