From b6ab8a0e9f8a11db9ebb4f04cc1983e2411185cf Mon Sep 17 00:00:00 2001 From: tombogle Date: Wed, 21 Aug 2024 17:24:38 -0400 Subject: [PATCH 1/5] +semver:major Changed IMDIArchivingDlgViewModel.ArchivingPackage to return an IMDIPackage Made ArchivingDlgViewModel.DisplayMessage public again --- CHANGELOG.md | 2 +- SIL.Archiving/ArchivingDlgViewModel.cs | 3 ++- SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs | 2 +- TestApps/ArchivingTestApp/MainForm.cs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe01a43cb..1a3d6c91a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - [SIL.Windows.Forms.Archiving] Split SIL.Archiving, moving Winforms portions (including dependency on L10nSharp) to SIL.Windows.Forms.Archiving. +- [SIL.Archiving] Changed IMDIArchivingDlgViewModel.ArchivingPackage to return an IMDIPackage (instead of an IArchivingPackage). - [SIL.Archiving] Required ArchivingDlgViewModel implementations to implement IDisposable. - [SIL.Archiving] Made protected members in ArchivingDlgViewModel private, adding protected accessors as needed. - [SIL.Archiving] In ArchivingDlgViewModel, renamed DisplayMessageEventHandler to MessageEventHandler, OnDisplayMessage to OnReportMessage, DisplayErrorEventHandler to ErrorEventHandler, and OnDisplayError to OnError. @@ -48,7 +49,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [SIL.Archiving] Made ArchivingDlgViewModel.ArchiveType property public and changed it from a string to Standard (new enum). - [SIL.Archiving] Changed signature of setFilesToArchive delegate in ArchivingDlgViewModel's protected constructor. - [SIL.Archiving] Changed return type of ArchivingDlgViewModel.Initialize (to make it async) and added two parameters. -- [SIL.Archiving] Changed ArchivingDlgViewModel.DisplayMessage from public to protected. - [SIL.Archiving] Changed the signature of protected methods in ArchivingDlgViewModel: LaunchArchivingProgram, GetFileExcludedMsg. - [SIL.Archiving] Changed the signature of the public method ArchivingDlgViewModel.CreatePackage. - [SIL.Archiving] Changed underlying type of public enums VernacularMaterialsType and SilDomain from ulong to long. diff --git a/SIL.Archiving/ArchivingDlgViewModel.cs b/SIL.Archiving/ArchivingDlgViewModel.cs index 3c50a99a4..29e9d52df 100644 --- a/SIL.Archiving/ArchivingDlgViewModel.cs +++ b/SIL.Archiving/ArchivingDlgViewModel.cs @@ -453,7 +453,8 @@ protected void DisplayMessage(StringId msgId, MessageType type, params object[] } /// ------------------------------------------------------------------------------------ - protected void DisplayMessage(string msg, MessageType type) + [PublicAPI] + public void DisplayMessage(string msg, MessageType type) { OnReportMessage?.Invoke(msg, type); } diff --git a/SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs b/SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs index fb0abaab0..169044441 100644 --- a/SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs +++ b/SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs @@ -349,7 +349,7 @@ public IArchivingSession AddSession(string sessionId) return session; } - public IArchivingPackage ArchivingPackage => _imdiData; + public IMDIPackage ArchivingPackage => _imdiData; /// public new string PathToProgramToLaunch diff --git a/TestApps/ArchivingTestApp/MainForm.cs b/TestApps/ArchivingTestApp/MainForm.cs index f8bcff64c..b0767f7e4 100644 --- a/TestApps/ArchivingTestApp/MainForm.cs +++ b/TestApps/ArchivingTestApp/MainForm.cs @@ -67,7 +67,7 @@ private void m_btnIMDI_Click(object sender, EventArgs e) foreach (var file in (from ListViewItem item in @group.Items select item.Text)) { session.AddFile(new ArchivingFile(file)); - session.AddFileAccess(file, (ArchivingPackage)model.ArchivingPackage); + session.AddFileAccess(file, model.ArchivingPackage); } session.Genre = "Dance"; From 032f35b967ec4eb3f91a88b9335ad96863d57055 Mon Sep 17 00:00:00 2001 From: tombogle Date: Fri, 23 Aug 2024 10:44:04 -0400 Subject: [PATCH 2/5] Removed explicit TargetFrameworks element from ArchivingTestApp.csproj --- TestApps/ArchivingTestApp/ArchivingTestApp.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/TestApps/ArchivingTestApp/ArchivingTestApp.csproj b/TestApps/ArchivingTestApp/ArchivingTestApp.csproj index 725af5e07..61c28ebe0 100644 --- a/TestApps/ArchivingTestApp/ArchivingTestApp.csproj +++ b/TestApps/ArchivingTestApp/ArchivingTestApp.csproj @@ -2,7 +2,6 @@ WinExe - net8.0-windows enable false false From d4ed309b47c7d37106fe7f9d99a63fb840a355cc Mon Sep 17 00:00:00 2001 From: tombogle Date: Fri, 23 Aug 2024 11:15:26 -0400 Subject: [PATCH 3/5] Added explicit dependencies on L10nSharp to Windows.Forms test projects whose SUTs depend on L10nSharp to prevent FileLoadExceptions when running tests --- .../SIL.Windows.Forms.Keyboarding.Tests.csproj | 1 + SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj | 1 + .../SIL.Windows.Forms.WritingSystems.Tests.csproj | 1 + TestApps/ArchivingTestApp/ArchivingTestApp.csproj | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj b/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj index a4fa46ae3..db2907920 100644 --- a/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj +++ b/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj @@ -7,6 +7,7 @@ + diff --git a/SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj b/SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj index 7d3c9e493..3a95c554f 100644 --- a/SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj +++ b/SIL.Windows.Forms.Tests/SIL.Windows.Forms.Tests.csproj @@ -22,6 +22,7 @@ + diff --git a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj index b40da9856..4a25873d0 100644 --- a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj +++ b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj @@ -10,6 +10,7 @@ + diff --git a/TestApps/ArchivingTestApp/ArchivingTestApp.csproj b/TestApps/ArchivingTestApp/ArchivingTestApp.csproj index 61c28ebe0..6f5d65f4b 100644 --- a/TestApps/ArchivingTestApp/ArchivingTestApp.csproj +++ b/TestApps/ArchivingTestApp/ArchivingTestApp.csproj @@ -12,7 +12,7 @@ - + From f906e892f89015419177ae8353dc227658216a59 Mon Sep 17 00:00:00 2001 From: tombogle Date: Fri, 23 Aug 2024 13:36:10 -0400 Subject: [PATCH 4/5] Tweaked things to try to get tests that depend on System.Memory to pass --- SIL.Windows.Forms.Keyboarding.Tests/App.config | 13 +++++++++++++ .../SIL.Windows.Forms.Keyboarding.Tests.csproj | 1 + SIL.Windows.Forms.WritingSystems.Tests/App.config | 2 +- .../SIL.Windows.Forms.WritingSystems.Tests.csproj | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 SIL.Windows.Forms.Keyboarding.Tests/App.config diff --git a/SIL.Windows.Forms.Keyboarding.Tests/App.config b/SIL.Windows.Forms.Keyboarding.Tests/App.config new file mode 100644 index 000000000..8a3d6d6d3 --- /dev/null +++ b/SIL.Windows.Forms.Keyboarding.Tests/App.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj b/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj index db2907920..a4000c3f2 100644 --- a/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj +++ b/SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj @@ -16,6 +16,7 @@ + diff --git a/SIL.Windows.Forms.WritingSystems.Tests/App.config b/SIL.Windows.Forms.WritingSystems.Tests/App.config index e6c577f71..8a3d6d6d3 100644 --- a/SIL.Windows.Forms.WritingSystems.Tests/App.config +++ b/SIL.Windows.Forms.WritingSystems.Tests/App.config @@ -6,7 +6,7 @@ - + diff --git a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj index 4a25873d0..c17c16ce8 100644 --- a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj +++ b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj @@ -18,6 +18,7 @@ + From 24a20f38b84cfda829a2f8dfa4a875373c1f0ed0 Mon Sep 17 00:00:00 2001 From: tombogle Date: Fri, 23 Aug 2024 16:42:45 -0400 Subject: [PATCH 5/5] Backed out changes to Windows.Forms.WritingSystemsTests that made things worse --- SIL.Windows.Forms.WritingSystems.Tests/App.config | 2 +- .../SIL.Windows.Forms.WritingSystems.Tests.csproj | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/SIL.Windows.Forms.WritingSystems.Tests/App.config b/SIL.Windows.Forms.WritingSystems.Tests/App.config index 8a3d6d6d3..e6c577f71 100644 --- a/SIL.Windows.Forms.WritingSystems.Tests/App.config +++ b/SIL.Windows.Forms.WritingSystems.Tests/App.config @@ -6,7 +6,7 @@ - + diff --git a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj index c17c16ce8..b40da9856 100644 --- a/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj +++ b/SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj @@ -10,7 +10,6 @@ - @@ -18,7 +17,6 @@ -