Skip to content

Commit 12dfea2

Browse files
committed
Non Real time data provider are missing the call of InitializeDataProvider fix #1556
1 parent 1069960 commit 12dfea2

File tree

5 files changed

+74
-60
lines changed

5 files changed

+74
-60
lines changed

Analogy/Analogy.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<OutputType>WinExe</OutputType>
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<TargetFrameworks>net48;net471;net7.0-windows;net6.0-windows</TargetFrameworks>
8-
<Version>4.10.0</Version>
8+
<Version>4.10.1</Version>
99
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1010
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1111
<IncludeSymbols>true</IncludeSymbols>

Analogy/CommonChangeLog.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public static IEnumerable<AnalogyChangeLog> GetChangeLog()
1111
{
1212
return new List<AnalogyChangeLog>
1313
{
14+
new AnalogyChangeLog("V4.10.1 - Non Real time data provider are missing the call of InitializeDataProvider #1556",AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2022, 11, 12)),
1415
new AnalogyChangeLog("V4.10.0 - reverse connect/disconnect icons #1552",AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2022, 11, 11)),
1516
new AnalogyChangeLog("V4.10.0 - Add NET7 Target Framework #1551",AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2022, 11, 10)),
1617
new AnalogyChangeLog("V4.10.0 - Reduce number of builds due to low usage. #1495", AnalogChangeLogType.Improvement, "Lior Banai",new DateTime(2022, 11, 10)),

Analogy/Forms/FluentDesignMainForm.cs

+14-9
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,10 @@ private void AddOfflineDataSource(FactoryContainer fc, IAnalogyDataProvidersFact
812812

813813
#region actions
814814

815-
void OpenOffline(string titleOfDataSource, string initialFolder, string[] files = null)
815+
async Task OpenOffline(string titleOfDataSource, string initialFolder, string[] files = null)
816816
{
817817
openedWindows++;
818+
await FactoriesManager.Instance.InitializeIfNeeded(offlineAnalogy);
818819
UserControl offlineUC = new LocalLogFilesUC(offlineAnalogy, files, initialFolder);
819820
var page = dockManager1.AddPanel(DockingStyle.Float);
820821
page.DockedAsTabbedDocument = true;
@@ -887,7 +888,10 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
887888
specificLocalFolder.Style = ElementStyle.Item;
888889
specificLocalFolder.Text = "Open Pre-defined Folder";
889890
specificLocalFolder.ImageOptions.Image = images?.GetLargeOpenFolderImage(factoryId) ?? Resources.OpenFolder_32x32;
890-
specificLocalFolder.Click += (sender, e) => { OpenOffline(title, specificDirectory); };
891+
specificLocalFolder.Click += async (sender, e) =>
892+
{
893+
await OpenOffline(title, specificDirectory);
894+
};
891895
}
892896

893897
AccordionControlElement recentFolders = new AccordionControlElement { Text = "Recent Folders" };
@@ -898,7 +902,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
898902
localfolder.Style = ElementStyle.Item;
899903
localfolder.Text = "Open Folder Selection";
900904
localfolder.ImageOptions.Image = images?.GetLargeOpenFolderImage(factoryId) ?? Resources.OpenFolder_32x32;
901-
localfolder.Click += (sender, e) =>
905+
localfolder.Click += async (sender, e) =>
902906
{
903907
using (var folderBrowserDialog = new XtraFolderBrowserDialog { ShowNewFolderButton = false })
904908
{
@@ -910,7 +914,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
910914
{
911915
if (!string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
912916
{
913-
OpenOffline(title, folderBrowserDialog.SelectedPath);
917+
await OpenOffline(title, folderBrowserDialog.SelectedPath);
914918
AddRecentFolder(recentFolders, offlineAnalogy, title, folderBrowserDialog.SelectedPath);
915919
}
916920
}
@@ -935,9 +939,9 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
935939
// args.Contents.Image = realTime.ToolTip.Image;
936940
toolTip.Setup(args);
937941
btn.SuperTip = toolTip;
938-
btn.Click += (s, be) =>
942+
btn.Click += async (s, be) =>
939943
{
940-
OpenOffline(offlineAnalogy.OptionalTitle, path.Path);
944+
await OpenOffline(offlineAnalogy.OptionalTitle, path.Path);
941945
};
942946
}
943947
}
@@ -955,7 +959,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
955959
acRootGroupHome.Elements.Add(openFiles);
956960
openFiles.Style = ElementStyle.Item;
957961
openFiles.ImageOptions.Image = offlineAnalogy.LargeImage ?? Resources.Article_32x32;
958-
openFiles.Click += (sender, e) =>
962+
openFiles.Click += async (sender, e) =>
959963
{
960964
OpenFileDialog openFileDialog1 = new OpenFileDialog
961965
{
@@ -965,7 +969,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
965969
};
966970
if (openFileDialog1.ShowDialog() == DialogResult.OK)
967971
{
968-
OpenOffline(title, offlineAnalogy.InitialFolderFullPath, openFileDialog1.FileNames);
972+
await OpenOffline(title, offlineAnalogy.InitialFolderFullPath, openFileDialog1.FileNames);
969973
AddRecentFiles(recentfiles, offlineAnalogy, title, openFileDialog1.FileNames.ToList());
970974
}
971975
};
@@ -1308,8 +1312,9 @@ private void AddSingleDataSources(FactoryContainer fc, IAnalogyDataProvidersFact
13081312
singleBtn.SuperTip = toolTip;
13091313
}
13101314
openedWindows++;
1311-
singleBtn.Click += (sender, e) =>
1315+
singleBtn.Click += async (sender, e) =>
13121316
{
1317+
await FactoriesManager.Instance.InitializeIfNeeded(single);
13131318
CancellationTokenSource cts = new CancellationTokenSource();
13141319
LocalLogFilesUC offlineUC = new LocalLogFilesUC(single, cts);
13151320
var page = dockManager1.AddPanel(DockingStyle.Float);

0 commit comments

Comments
 (0)