diff --git a/Doc/Content/VersionHistory/VersionHistory.aml b/Doc/Content/VersionHistory/VersionHistory.aml index 9f0c541..e68af72 100644 --- a/Doc/Content/VersionHistory/VersionHistory.aml +++ b/Doc/Content/VersionHistory/VersionHistory.aml @@ -15,6 +15,11 @@ Data Interchange (PDI) Library over the life of the project.Select a version below to see a description of its changes. + + + + + diff --git a/Doc/Content/VersionHistory/v2023.1.2.0.aml b/Doc/Content/VersionHistory/v2023.1.2.0.aml new file mode 100644 index 0000000..a1667b9 --- /dev/null +++ b/Doc/Content/VersionHistory/v2023.1.2.0.aml @@ -0,0 +1,29 @@ + + + + + Release notes for version 2023.1.2.0. + + +
+ + + + Added support for net6.0-windows to the +EWSoftware.PDI.Windows.Forms library. + + + + Updated all Windows Forms demo projects to support .NET 6.0. + + + + +
+ + + + + +
+
diff --git a/Doc/ContentLayout.content b/Doc/ContentLayout.content index e57a0c6..5547ece 100644 --- a/Doc/ContentLayout.content +++ b/Doc/ContentLayout.content @@ -112,11 +112,16 @@ - + + + + + + diff --git a/Doc/EWSoftwarePDI.shfbproj b/Doc/EWSoftwarePDI.shfbproj index e5b8427..6205908 100644 --- a/Doc/EWSoftwarePDI.shfbproj +++ b/Doc/EWSoftwarePDI.shfbproj @@ -29,7 +29,7 @@ .NET Framework 4.0 EWSoftware.PDI Namespace Documentation https://github.com/EWSoftware/PDI - [v{%40HelpFileVersion}] Copyright \xA9 2003-2021, Eric Woodruff, All Rights Reserved + [v{%40HelpFileVersion}] Copyright \xA9 2003-2023, Eric Woodruff, All Rights Reserved Eric%40EWoodruff.us Default2022 Standard @@ -49,7 +49,7 @@ Personal Data Interchange ASP.NET web server control designers developed by Eric Woodruff. Personal Data Interchange Windows Forms controls developed by Eric Woodruff. - 2021.11.23.0 + 2022.1.2.0 @@ -194,6 +194,7 @@ + diff --git a/MasterBuild.bat b/MasterBuild.bat index e45135c..da2cb49 100644 --- a/MasterBuild.bat +++ b/MasterBuild.bat @@ -16,9 +16,9 @@ IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15 IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\MSBuild.exe" IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Professional\MSBuild\Current\bin\MSBuild.exe" IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\MSBuild.exe" -IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Community\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\MSBuild.exe" -IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Professional\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin\MSBuild.exe" -IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\202\Enterprise\MSBuild\Current" SET "MSBUILD=%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\MSBuild.exe" +IF EXIST "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current" SET "MSBUILD=%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\MSBuild.exe" +IF EXIST "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current" SET "MSBUILD=%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\bin\MSBuild.exe" +IF EXIST "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current" SET "MSBUILD=%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\MSBuild.exe" "%MSBUILD%" /nologo /v:m /m Source\EWSPDI.sln /t:Clean;Build "/p:Configuration=Release;Platform=Any CPU" diff --git a/Source/.editorconfig b/Source/.editorconfig index ede92a4..e37dee4 100644 --- a/Source/.editorconfig +++ b/Source/.editorconfig @@ -35,6 +35,12 @@ dotnet_style_explicit_tuple_names = true : error dotnet_style_null_propagation = true : suggestion dotnet_style_object_initializer = true : suggestion +# CA1303: Do not pass literals as localized parameters +dotnet_diagnostic.CA1303.severity = none + +# IDE1006: Naming Styles +dotnet_diagnostic.IDE1006.severity = none + # CSharp code style settings [*.cs] csharp_style_var_elsewhere = false : none @@ -94,9 +100,6 @@ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false csharp_space_between_method_declaration_name_and_open_parenthesis = false csharp_space_between_method_declaration_parameter_list_parentheses = false -# CA1303: Do not pass literals as localized parameters -dotnet_diagnostic.CA1303.severity = none - # IDE0010: Add missing cases dotnet_diagnostic.IDE0010.severity = none @@ -118,9 +121,6 @@ dotnet_diagnostic.IDE0055.severity = none # IDE0058: Expression value is never used dotnet_diagnostic.IDE0058.severity = none -# IDE1006: Naming Styles -dotnet_diagnostic.IDE1006.severity = none - # These are disabled as we're still targeting .NET Framework as well and I don't want a lot of conditional code # to suppress these. # IDE0056: Use index operator @@ -131,3 +131,9 @@ dotnet_diagnostic.IDE0057.severity = none # IDE0063: Use simple 'using' statement dotnet_diagnostic.IDE0063.severity = none + +# IDE0066: Convert switch statement to expression +dotnet_diagnostic.IDE0066.severity = none + +# IDE0090: Use 'new(...)' +dotnet_diagnostic.IDE0090.severity = none diff --git a/Source/CSharpDemos.sln b/Source/CSharpDemos.sln index bd6fe5e..ba08c45 100644 --- a/Source/CSharpDemos.sln +++ b/Source/CSharpDemos.sln @@ -1,19 +1,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2002 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CalendarBrowser", "CSharpDemos\CalendarBrowser\CalendarBrowser.csproj", "{20487237-F96A-4725-A82D-96FD26AF9DFE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalendarBrowser", "CSharpDemos\CalendarBrowser\CalendarBrowser.csproj", "{20487237-F96A-4725-A82D-96FD26AF9DFE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDIWinFormsTest", "CSharpDemos\PDIWinFormsTest\PDIWinFormsTest.csproj", "{011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vCardBrowser", "CSharpDemos\vCardBrowser\vCardBrowser.csproj", "{AC9020EB-63D3-4515-A868-8D290356FBE5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vCardBrowser", "CSharpDemos\vCardBrowser\vCardBrowser.csproj", "{AC9020EB-63D3-4515-A868-8D290356FBE5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D3E23A2C-E571-4DF2-BCA1-172B2C994300}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig Common.vsspell = Common.vsspell CSharpDemos.sln.vsspell = CSharpDemos.sln.vsspell - EWSPDIDemos.ruleset = EWSPDIDemos.ruleset EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EWSoftware.PDI", "EWSPDI\EWSoftware.PDI.csproj", "{024821DE-3508-476A-97E7-441334A1B2DF}" @@ -28,6 +25,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDIParserTest", "CSharpDemo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RFC2445RecurTest", "CSharpDemos\RFC2445RecurTest\RFC2445RecurTest.csproj", "{E0D46484-AAAE-41A1-85A7-9903B3DACB28}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PDIWinFormsTest", "CSharpDemos\PDIWinFormsTest\PDIWinFormsTest.csproj", "{969B43B1-5E6E-4C96-AE49-36A4D88119D8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,10 +37,6 @@ Global {20487237-F96A-4725-A82D-96FD26AF9DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {20487237-F96A-4725-A82D-96FD26AF9DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU {20487237-F96A-4725-A82D-96FD26AF9DFE}.Release|Any CPU.Build.0 = Release|Any CPU - {011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A}.Release|Any CPU.Build.0 = Release|Any CPU {AC9020EB-63D3-4515-A868-8D290356FBE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC9020EB-63D3-4515-A868-8D290356FBE5}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC9020EB-63D3-4515-A868-8D290356FBE5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -70,6 +65,10 @@ Global {E0D46484-AAAE-41A1-85A7-9903B3DACB28}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0D46484-AAAE-41A1-85A7-9903B3DACB28}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0D46484-AAAE-41A1-85A7-9903B3DACB28}.Release|Any CPU.Build.0 = Release|Any CPU + {969B43B1-5E6E-4C96-AE49-36A4D88119D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {969B43B1-5E6E-4C96-AE49-36A4D88119D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {969B43B1-5E6E-4C96-AE49-36A4D88119D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {969B43B1-5E6E-4C96-AE49-36A4D88119D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Source/CSharpDemos/CalendarBrowser/AttachmentsControl.cs b/Source/CSharpDemos/CalendarBrowser/AttachmentsControl.cs index 6674a8a..c1b36de 100644 --- a/Source/CSharpDemos/CalendarBrowser/AttachmentsControl.cs +++ b/Source/CSharpDemos/CalendarBrowser/AttachmentsControl.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : AttachmentsControl.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/24/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a calendar object's attachment properties // @@ -82,9 +81,9 @@ public void SetValues(AttachPropertyCollection attachments) foreach(AttachProperty a in attach) { if(a.ValueLocation == ValLocValue.Binary) - desc = String.Format("Inline - {0}", a.FormatType); + desc = $"Inline - {a.FormatType}"; else - desc = String.Format("External - {0}, {1}", a.FormatType, a.Value); + desc = $"External - {a.FormatType}, {a.Value}"; lbAttachments.Items.Add(desc); } @@ -103,8 +102,8 @@ public void SetValues(AttachPropertyCollection attachments) /// The attachments collection to update public void GetValues(AttachPropertyCollection attachments) { - attachments.Clear(); - attachments.CloneRange(attach); + attachments?.Clear(); + attachments?.CloneRange(attach); } #endregion @@ -177,7 +176,7 @@ private void btnAdd_Click(object sender, EventArgs e) { a.ValueLocation = ValLocValue.Uri; a.Value = txtFilename.Text; - desc = String.Format("External - {0}, {1}", a.FormatType, a.Value); + desc = $"External - {a.FormatType}, {a.Value}"; } else { @@ -190,7 +189,7 @@ private void btnAdd_Click(object sender, EventArgs e) a.SetAttachmentBytes(byData); } - desc = String.Format("Inline - {0}", a.FormatType); + desc = $"Inline - {a.FormatType}"; } attach.Add(a); @@ -198,7 +197,7 @@ private void btnAdd_Click(object sender, EventArgs e) } catch(Exception ex) { - string error = String.Format("Unable to add attachment:\n{0}", ex.Message); + string error = $"Unable to add attachment:\n{ex.Message}"; if(ex.InnerException != null) { @@ -278,7 +277,7 @@ private void btnDetach_Click(object sender, EventArgs e) } catch(Exception ex) { - string error = String.Format("Unable to save attachment:\n{0}", ex.Message); + string error = $"Unable to save attachment:\n{ex.Message}"; if(ex.InnerException != null) { diff --git a/Source/CSharpDemos/CalendarBrowser/CalendarBrowser.csproj b/Source/CSharpDemos/CalendarBrowser/CalendarBrowser.csproj index ba0da75..84e64ea 100644 --- a/Source/CSharpDemos/CalendarBrowser/CalendarBrowser.csproj +++ b/Source/CSharpDemos/CalendarBrowser/CalendarBrowser.csproj @@ -1,316 +1,26 @@ - - + - Local - 8.0.50727 - 2.0 - {20487237-F96A-4725-A82D-96FD26AF9DFE} - Debug - AnyCPU - App.ico - - - CalendarBrowser - CalendarBrowser.snk - JScript - Grid - IE50 - false WinExe - CalendarBrowser - OnBuildSuccess - - - - - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - ..\..\EWSPDIDemos.ruleset - false - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + CalendarBrowser.snk true + true + AllEnabledByDefault - - app.manifest - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - TimeZoneRegInfo.cs - Code - - - Form - - - AboutDlg.cs - - - UserControl - - - AlarmControl.cs - - - Code - - - UserControl - - - AttachmentsControl.cs - - - UserControl - - - AttendeeControl.cs - - - Form - - - CalendarBrowserForm.cs - - - Form - - - CalendarObjectDlg.cs - - - UserControl - - - FreeBusyControl.cs - - - - UserControl - - - ObservanceRuleControl.cs - - - - True - True - Resources.resx - - - UserControl - - - RecurrenceControl.cs - - - UserControl - - - RequestStatusControl.cs - - - Form - - - TimeZoneListDlg.cs - - - Form - - - VFreeBusyDlg.cs - - - Form - - - VTimeZoneDlg.cs - - - AboutDlg.cs - Designer - - - AlarmControl.cs - Designer - - - AttachmentsControl.cs - Designer - - - AttendeeControl.cs - Designer - - - CalendarBrowserForm.cs - Designer - - - CalendarObjectDlg.cs - Designer - - - FreeBusyControl.cs - Designer - - - ObservanceRuleControl.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - - - RecurrenceControl.cs - Designer - - - RequestStatusControl.cs - Designer - - - TimeZoneListDlg.cs - Designer - - - VFreeBusyDlg.cs - Designer - - - VTimeZoneDlg.cs - Designer - - - - - - - - - + - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + + + - - - {5eda55cb-e991-4c50-93cb-149d7c4d498c} - EWSoftware.PDI.Data - - - {af3e8bed-a706-4c25-8379-2882641a221a} - EWSoftware.PDI.Windows.Forms - - - {024821de-3508-476a-97e7-441334a1b2df} - EWSoftware.PDI - - - - - - - - - \ No newline at end of file diff --git a/Source/CSharpDemos/CalendarBrowser/CalendarBrowserForm.cs b/Source/CSharpDemos/CalendarBrowser/CalendarBrowserForm.cs index 75187f5..6982f6c 100644 --- a/Source/CSharpDemos/CalendarBrowser/CalendarBrowserForm.cs +++ b/Source/CSharpDemos/CalendarBrowser/CalendarBrowserForm.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : CalendarBrowserForm.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/24/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is a simple demonstration application that shows how to load, save, and manage vCalendar and iCalendar // files including how to edit the properties on the various components. @@ -45,7 +44,7 @@ public partial class CalendarBrowserForm : System.Windows.Forms.Form private VCalendar vCal; // The calendar being browsed private bool wasModified; - private StringFormat sf; + private readonly StringFormat sf; #endregion @@ -271,23 +270,29 @@ private void miOpen_Click(object sender, EventArgs e) if(vCal.Events.Count != 0) cboComponents.SelectedIndex = 0; else + { if(vCal.ToDos.Count != 0) cboComponents.SelectedIndex = 1; else + { if(vCal.Journals.Count != 0) cboComponents.SelectedIndex = 2; else + { if(vCal.FreeBusys.Count != 0) cboComponents.SelectedIndex = 3; else cboComponents.SelectedIndex = 0; + } + } + } LoadGridWithItems(true); lblFilename.Text = dlg.FileName; } catch(Exception ex) { - string error = String.Format("Unable to load calendar:\n{0}", ex.Message); + string error = $"Unable to load calendar:\n{ex.Message}"; if(ex.InnerException != null) { @@ -354,7 +359,7 @@ private void miSave_Click(object sender, EventArgs e) } catch(Exception ex) { - string error = String.Format("Unable to save calendar:\n{0}", ex.Message); + string error = $"Unable to save calendar:\n{ex.Message}"; if(ex.InnerException != null) { @@ -786,9 +791,9 @@ private static int CalendarSorter(CalendarObject x, CalendarObject y) DateTime d1, d2; string summary1, summary2; - if(x is VEvent) + if(x is VEvent e1) { - VEvent e1 = (VEvent)x, e2 = (VEvent)y; + VEvent e2 = (VEvent)y; d1 = e1.StartDateTime.TimeZoneDateTime; d2 = e2.StartDateTime.TimeZoneDateTime; @@ -796,9 +801,10 @@ private static int CalendarSorter(CalendarObject x, CalendarObject y) summary2 = e2.Summary.Value; } else - if(x is VToDo) + { + if(x is VToDo t1) { - VToDo t1 = (VToDo)x, t2 = (VToDo)y; + VToDo t2 = (VToDo)y; d1 = t1.StartDateTime.TimeZoneDateTime; d2 = t2.StartDateTime.TimeZoneDateTime; @@ -806,9 +812,10 @@ private static int CalendarSorter(CalendarObject x, CalendarObject y) summary2 = t2.Summary.Value; } else - if(x is VJournal) + { + if(x is VJournal j1) { - VJournal j1 = (VJournal)x, j2 = (VJournal)y; + VJournal j2 = (VJournal)y; d1 = j1.StartDateTime.TimeZoneDateTime; d2 = j2.StartDateTime.TimeZoneDateTime; @@ -824,6 +831,8 @@ private static int CalendarSorter(CalendarObject x, CalendarObject y) summary1 = f1.Organizer.Value; summary2 = f2.Organizer.Value; } + } + } if(d1.CompareTo(d2) == 0) { @@ -834,7 +843,7 @@ private static int CalendarSorter(CalendarObject x, CalendarObject y) summary2 = String.Empty; // For descending order, change this to compare summary 2 to summary 1 instead - return String.Compare(summary1, summary2, StringComparison.CurrentCulture); + return String.Compare(summary1, summary2, StringComparison.Ordinal); } // For descending order, change this to compare date 2 to date 1 instead @@ -866,58 +875,70 @@ private void dgvCalendar_CellPainting(object sender, DataGridViewCellPaintingEve if(e.ColumnIndex == 0) { - if(item is VEvent) - startProp = ((VEvent)item).StartDateTime; + if(item is VEvent ev) + startProp = ev.StartDateTime; else - if(item is VToDo) - startProp = ((VToDo)item).StartDateTime; + { + if(item is VToDo td) + startProp = td.StartDateTime; else - if(item is VJournal) - startProp = ((VJournal)item).StartDateTime; + { + if(item is VJournal jr) + startProp = jr.StartDateTime; else startProp = ((VFreeBusy)item).StartDateTime; + } + } dti = VCalendar.TimeZoneTimeInfo(startProp.TimeZoneDateTime, startProp.TimeZoneId); // Format as date or date/time and include time zone if available if(startProp.ValueLocation == ValLocValue.Date) - columnText = String.Format("{0:d} {1}", dti.StartDateTime, dti.AbbreviatedStartTimeZoneName); + columnText = $"{dti.StartDateTime:d} {dti.AbbreviatedStartTimeZoneName}"; else - columnText = String.Format("{0} {1}", dti.StartDateTime, dti.AbbreviatedStartTimeZoneName); + columnText = $"{dti.StartDateTime} {dti.AbbreviatedStartTimeZoneName}"; } else + { if(e.ColumnIndex == 1) { - if(item is VEvent) + if(item is VEvent ev) { - summaryProp = ((VEvent)item).Summary; - descProp = ((VEvent)item).Description; + summaryProp = ev.Summary; + descProp = ev.Description; } else - if(item is VToDo) + { + if(item is VToDo td) { - summaryProp = ((VToDo)item).Summary; - descProp = ((VToDo)item).Description; + summaryProp = td.Summary; + descProp = td.Description; } else - if(item is VJournal) + { + if(item is VJournal jr) { - summaryProp = ((VJournal)item).Summary; - descProp = ((VJournal)item).Description; + summaryProp = jr.Summary; + descProp = jr.Description; } else { summaryProp = null; descProp = null; } + } + } // If summary is empty, use description instead if(summaryProp != null && summaryProp.Value != null) columnText = summaryProp.Value; else + { if(descProp != null) columnText = descProp.Value; + } } + } if(columnText != null) { diff --git a/Source/CSharpDemos/CalendarBrowser/CalendarObjectDlg.cs b/Source/CSharpDemos/CalendarBrowser/CalendarObjectDlg.cs index 4a9a5d3..7a71c3c 100644 --- a/Source/CSharpDemos/CalendarBrowser/CalendarObjectDlg.cs +++ b/Source/CSharpDemos/CalendarBrowser/CalendarObjectDlg.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : CalendarObjectDlg.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/24/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a calendar object's properties (VEvent, VToDo, or a VJournal component) // @@ -77,7 +76,7 @@ public CalendarObjectDlg() public void SetValues(CalendarObject oCal) { string timeZoneId = null; - bool isICalendar = (oCal.Version == SpecificationVersions.iCalendar20); + bool isICalendar = (oCal?.Version == SpecificationVersions.iCalendar20); // Disable controls that aren't relevant to the vCalendar spec txtDuration.Enabled = txtOrganizer.Enabled = ucRequestStatus.Enabled = txtLatitude.Enabled = @@ -93,8 +92,8 @@ public void SetValues(CalendarObject oCal) // Header txtUniqueId.Text = e.UniqueId.Value; chkTransparent.Checked = e.Transparency.IsTransparent; - txtCreated.Text = e.DateCreated.TimeZoneDateTime.ToString("G"); - txtLastModified.Text = e.LastModified.TimeZoneDateTime.ToString("G"); + txtCreated.Text = e.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); + txtLastModified.Text = e.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); txtClass.Text = e.Classification.Value; udcSequence.Value = e.Sequence.SequenceNumber; udcPriority.Value = e.Priority.PriorityValue; @@ -156,8 +155,8 @@ public void SetValues(CalendarObject oCal) ucAlarms.BindingSource.DataSource = new VAlarmCollection().CloneRange(e.Alarms); // Miscellaneous - txtLatitude.Text = e.GeographicPosition.Latitude.ToString(); - txtLongitude.Text = e.GeographicPosition.Longitude.ToString(); + txtLatitude.Text = e.GeographicPosition.Latitude.ToString(CultureInfo.CurrentCulture); + txtLongitude.Text = e.GeographicPosition.Longitude.ToString(CultureInfo.CurrentCulture); ucRequestStatus.BindingSource.DataSource = new RequestStatusPropertyCollection().CloneRange(e.RequestStatuses); @@ -175,8 +174,8 @@ public void SetValues(CalendarObject oCal) // Header txtUniqueId.Text = td.UniqueId.Value; - txtCreated.Text = td.DateCreated.TimeZoneDateTime.ToString("G"); - txtLastModified.Text = td.LastModified.TimeZoneDateTime.ToString("G"); + txtCreated.Text = td.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); + txtLastModified.Text = td.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); txtClass.Text = td.Classification.Value; udcSequence.Value = td.Sequence.SequenceNumber; udcPriority.Value = td.Priority.PriorityValue; @@ -248,8 +247,8 @@ public void SetValues(CalendarObject oCal) ucAlarms.BindingSource.DataSource = new VAlarmCollection().CloneRange(td.Alarms); // Miscellaneous - txtLatitude.Text = td.GeographicPosition.Latitude.ToString(); - txtLongitude.Text = td.GeographicPosition.Longitude.ToString(); + txtLatitude.Text = td.GeographicPosition.Latitude.ToString(CultureInfo.CurrentCulture); + txtLongitude.Text = td.GeographicPosition.Longitude.ToString(CultureInfo.CurrentCulture); ucRequestStatus.BindingSource.DataSource = new RequestStatusPropertyCollection().CloneRange(td.RequestStatuses); @@ -271,8 +270,8 @@ public void SetValues(CalendarObject oCal) // Header txtUniqueId.Text = j.UniqueId.Value; - txtCreated.Text = j.DateCreated.TimeZoneDateTime.ToString("G"); - txtLastModified.Text = j.LastModified.TimeZoneDateTime.ToString("G"); + txtCreated.Text = j.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); + txtLastModified.Text = j.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture); txtClass.Text = j.Classification.Value; udcSequence.Value = j.Sequence.SequenceNumber; @@ -554,9 +553,9 @@ public void GetValues(CalendarObject oCal) // Set the time zone in the object after getting all the data. The "Set" method will not modify the // date/times like the "Apply" method does. if(cboTimeZone.Enabled && cboTimeZone.SelectedIndex != 0) - oCal.SetTimeZone(VCalendar.TimeZones[cboTimeZone.SelectedIndex - 1]); + oCal?.SetTimeZone(VCalendar.TimeZones[cboTimeZone.SelectedIndex - 1]); else - oCal.SetTimeZone(null); + oCal?.SetTimeZone(null); } #endregion @@ -590,10 +589,12 @@ private void btnApplyTZ_Click(object sender, EventArgs e) return; } - if(MessageBox.Show(String.Format("Do you want to convert all times from the '{0}' time zone to " + - "the '{1}' time zone?", cboTimeZone.Items[timeZoneIdx], cboTimeZone.Items[cboTimeZone.SelectedIndex]), - "Change Time Zone", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + if(MessageBox.Show($"Do you want to convert all times from the '{cboTimeZone.Items[timeZoneIdx]}' " + + $"time zone to the '{cboTimeZone.Items[cboTimeZone.SelectedIndex]}' time zone?", "Change Time Zone", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { return; + } // Get the time zone IDs if(timeZoneIdx == 0) @@ -647,12 +648,15 @@ private void btnApplyTZ_Click(object sender, EventArgs e) /// The event parameters private void btnFind_Click(object sender, EventArgs e) { - string url = String.Format("https://www.google.com/maps/place/{0},{1}", txtLatitude.Text, - txtLongitude.Text); + string url = $"https://www.google.com/maps/place/{txtLatitude.Text},{txtLongitude.Text}"; try { - System.Diagnostics.Process.Start(url); + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo + { + FileName = url, + UseShellExecute = true, + }); } catch(Exception ex) { diff --git a/Source/CSharpDemos/CalendarBrowser/GlobalSuppressions.cs b/Source/CSharpDemos/CalendarBrowser/GlobalSuppressions.cs index aafa301..7bf3cf4 100644 Binary files a/Source/CSharpDemos/CalendarBrowser/GlobalSuppressions.cs and b/Source/CSharpDemos/CalendarBrowser/GlobalSuppressions.cs differ diff --git a/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfo.cs b/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfo.cs index 5c10825..4137c90 100644 --- a/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfo.cs +++ b/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfo.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/29/2014 -// Note : Copyright 2004-2014, Eric Woodruff, All rights reserved -// Compiler: Microsoft Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // vCalendar/iCalendar Browser demo assembly attributes // diff --git a/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfoShared.cs b/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfoShared.cs index 357c253..9bc7f75 100644 --- a/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfoShared.cs +++ b/Source/CSharpDemos/CalendarBrowser/Properties/AssemblyInfoShared.cs @@ -2,8 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/23/2021 -// Note : Copyright 2004-2021, Eric Woodruff, All rights reserved +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // PDI library demos common assembly attributes // @@ -27,7 +27,7 @@ // General assembly information [assembly: AssemblyProduct("EWSoftware Personal Data Interchange Library")] [assembly: AssemblyCompany("Eric Woodruff")] -[assembly: AssemblyCopyright("Copyright \xA9 2003-2021, Eric Woodruff, All Rights Reserved")] +[assembly: AssemblyCopyright("Copyright \xA9 2003-2023, Eric Woodruff, All Rights Reserved")] [assembly: AssemblyCulture("")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] @@ -44,6 +44,10 @@ // Resources contained within the assembly are English [assembly: NeutralResourcesLanguage("en")] +#if NET6_0_OR_GREATER +[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")] +#endif + // Version numbers. All version numbers for an assembly consists of the following four values: // // Year of release @@ -51,5 +55,5 @@ // Day of release // Revision (typically zero unless multiple releases are made on the same day) // -[assembly: AssemblyVersion("2021.11.23.0")] -[assembly: AssemblyFileVersion("21.11.23.0")] +[assembly: AssemblyVersion("2023.1.2.0")] +[assembly: AssemblyFileVersion("23.1.2.0")] diff --git a/Source/CSharpDemos/CalendarBrowser/Properties/Resources.Designer.cs b/Source/CSharpDemos/CalendarBrowser/Properties/Resources.Designer.cs deleted file mode 100644 index 1239594..0000000 --- a/Source/CSharpDemos/CalendarBrowser/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace CalendarBrowser.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CalendarBrowser.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Source/CSharpDemos/CalendarBrowser/Properties/Resources.resx b/Source/CSharpDemos/CalendarBrowser/Properties/Resources.resx deleted file mode 100644 index 1af7de1..0000000 --- a/Source/CSharpDemos/CalendarBrowser/Properties/Resources.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Source/CSharpDemos/CalendarBrowser/RecurrenceControl.cs b/Source/CSharpDemos/CalendarBrowser/RecurrenceControl.cs index 64eae5f..2c0a7f7 100644 --- a/Source/CSharpDemos/CalendarBrowser/RecurrenceControl.cs +++ b/Source/CSharpDemos/CalendarBrowser/RecurrenceControl.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : RecurrenceControl.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/24/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a recurring calendar object's recurrence rule and recurrence date properties // @@ -39,8 +38,8 @@ public partial class RecurrenceControl : System.Windows.Forms.UserControl #region Private data members //===================================================================== - private RRulePropertyCollection rRules; - private RDatePropertyCollection rDates; + private readonly RRulePropertyCollection rRules; + private readonly RDatePropertyCollection rDates; private bool editsExceptions; #endregion @@ -136,10 +135,12 @@ public void SetValues(RRulePropertyCollection rr, RDatePropertyCollection rd) lbRDates.Items.Clear(); foreach(RDateProperty rdt in rDates) + { if(rdt.ValueLocation == ValLocValue.Date) - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d")); + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d", CultureInfo.CurrentCulture)); else - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G")); + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture)); + } this.SetButtonStates(); } @@ -151,6 +152,9 @@ public void SetValues(RRulePropertyCollection rr, RDatePropertyCollection rd) /// The exception dates from which to get the settings public void SetValues(RRulePropertyCollection er, ExDatePropertyCollection ed) { + if(ed == null) + throw new ArgumentNullException(nameof(ed)); + rRules.Clear(); rDates.Clear(); rRules.CloneRange(er); @@ -177,9 +181,9 @@ public void SetValues(RRulePropertyCollection er, ExDatePropertyCollection ed) foreach(RDateProperty rdt in rDates) if(rdt.ValueLocation == ValLocValue.Date) - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d")); + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d", CultureInfo.CurrentCulture)); else - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G")); + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture)); this.SetButtonStates(); } @@ -193,10 +197,10 @@ public void SetValues(RRulePropertyCollection er, ExDatePropertyCollection ed) /// make sure that it is consistent with the containing component. public void GetValues(RRulePropertyCollection rr, RDatePropertyCollection rd) { - rr.Clear(); - rd.Clear(); - rr.CloneRange(rRules); - rd.CloneRange(rDates); + rr?.Clear(); + rd?.Clear(); + rr?.CloneRange(rRules); + rd?.CloneRange(rDates); } /// @@ -208,9 +212,9 @@ public void GetValues(RRulePropertyCollection rr, RDatePropertyCollection rd) /// make sure that it is consistent with the containing component. public void GetValues(RRulePropertyCollection er, ExDatePropertyCollection ed) { - er.Clear(); - ed.Clear(); - er.CloneRange(rRules); + er?.Clear(); + ed?.Clear(); + er?.CloneRange(rRules); // Convert the RDates to ExDate format foreach(RDateProperty rdate in rDates) @@ -222,7 +226,7 @@ public void GetValues(RRulePropertyCollection er, ExDatePropertyCollection ed) TimeZoneDateTime = rdate.TimeZoneDateTime }; - ed.Add(edate); + ed?.Add(edate); } } @@ -248,7 +252,7 @@ public void ApplyTimeZone(string oldTZ, string newTZ) dti = VCalendar.TimeZoneToTimeZone(rdt.TimeZoneDateTime, oldTZ, newTZ); rdt.TimeZoneDateTime = dti.StartDateTime; - lbRDates.Items[idx] = dti.StartDateTime.ToString("G"); + lbRDates.Items[idx] = dti.StartDateTime.ToString("G", CultureInfo.CurrentCulture); } idx++; @@ -375,14 +379,14 @@ private void btnAddRDate_Click(object sender, EventArgs e) }; rDates.Add(rdate); - lbRDates.Items.Add(dtpRDate.Value.Date.ToString("d")); + lbRDates.Items.Add(dtpRDate.Value.Date.ToString("d", CultureInfo.CurrentCulture)); } else { RDateProperty rdate = new RDateProperty { TimeZoneDateTime = dtpRDate.Value }; rDates.Add(rdate); - lbRDates.Items.Add(dtpRDate.Value.ToString("G")); + lbRDates.Items.Add(dtpRDate.Value.ToString("G", CultureInfo.CurrentCulture)); } this.SetButtonStates(); diff --git a/Source/CSharpDemos/CalendarBrowser/VFreeBusyDlg.cs b/Source/CSharpDemos/CalendarBrowser/VFreeBusyDlg.cs index b07e02c..ef87025 100644 --- a/Source/CSharpDemos/CalendarBrowser/VFreeBusyDlg.cs +++ b/Source/CSharpDemos/CalendarBrowser/VFreeBusyDlg.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : VFreeBusyDlg.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/24/2018 -// Note : Copyright 2004-2014, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a VFreeBusy object's properties // @@ -77,6 +76,9 @@ public VFreeBusyDlg() /// The free/busy object from which to get the settings public void SetValues(VFreeBusy fb) { + if(fb == null) + throw new ArgumentNullException(nameof(fb)); + string timeZoneId = fb.StartDateTime.TimeZoneId; txtUniqueId.Text = fb.UniqueId.Value; @@ -132,6 +134,9 @@ public void SetValues(VFreeBusy fb) /// The free/busy object in which the settings are updated public void GetValues(VFreeBusy fb) { + if(fb == null) + throw new ArgumentNullException(nameof(fb)); + // The unique ID is not changed fb.Organizer.Value = txtOrganizer.Text; fb.Contact.Value = txtContact.Text; @@ -208,10 +213,12 @@ private void btnApplyTZ_Click(object sender, EventArgs e) return; } - if(MessageBox.Show(String.Format("Do you want to convert all times from the '{0}' time zone to " + - "the '{1}' time zone?", cboTimeZone.Items[timeZoneIdx], cboTimeZone.Items[cboTimeZone.SelectedIndex]), - "Change Time Zone", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + if(MessageBox.Show($"Do you want to convert all times from the '{cboTimeZone.Items[timeZoneIdx]}' " + + $"time zone to the '{cboTimeZone.Items[cboTimeZone.SelectedIndex]}' time zone?", "Change Time Zone", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { return; + } // Get the time zone IDs if(timeZoneIdx == 0) @@ -269,7 +276,7 @@ private void VFreeBusyDlg_Closing(object sender, CancelEventArgs e) epErrors.Clear(); - if(txtDuration.Text.Length != 0 && !Duration.TryParse(txtDuration.Text, out Duration d)) + if(txtDuration.Text.Length != 0 && !Duration.TryParse(txtDuration.Text, out _)) { epErrors.SetError(txtDuration, "Invalid duration value"); e.Cancel = true; diff --git a/Source/CSharpDemos/CalendarBrowser/VTimeZoneDlg.cs b/Source/CSharpDemos/CalendarBrowser/VTimeZoneDlg.cs index f49c02f..e8d5814 100644 --- a/Source/CSharpDemos/CalendarBrowser/VTimeZoneDlg.cs +++ b/Source/CSharpDemos/CalendarBrowser/VTimeZoneDlg.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : VTimeZoneDlg.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/29/2014 -// Note : Copyright 2004-2014, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a VTimeZone object's properties // @@ -21,6 +20,7 @@ using System; using System.ComponentModel; +using System.Globalization; using System.Windows.Forms; using EWSoftware.PDI.Objects; @@ -60,9 +60,12 @@ public VTimeZoneDlg() /// The time zone object from which to get the settings public void SetValues(VTimeZone tz) { + if(tz == null) + throw new ArgumentNullException(nameof(tz)); + originalId = txtTimeZoneId.Text = tz.TimeZoneId.Value; txtTimeZoneUrl.Text = tz.TimeZoneUrl.Value; - txtLastModified.Text = tz.LastModified.DateTimeValue.ToString("G"); + txtLastModified.Text = tz.LastModified.DateTimeValue.ToString("G", CultureInfo.InvariantCulture); // We could bind directly to the existing collection but that would modify it. To preserve the // original items, we'll pass a copy of the collection instead. @@ -75,6 +78,9 @@ public void SetValues(VTimeZone tz) /// The time zone object in which the settings are updated public void GetValues(VTimeZone tz) { + if(tz == null) + throw new ArgumentNullException(nameof(tz)); + tz.TimeZoneId.Value = txtTimeZoneId.Text; tz.TimeZoneUrl.Value = txtTimeZoneUrl.Text; tz.LastModified.DateTimeValue = DateTime.Now; diff --git a/Source/CSharpDemos/PDIDatesTest/GlobalSuppressions.cs b/Source/CSharpDemos/PDIDatesTest/GlobalSuppressions.cs index 24af456..9ef8f5d 100644 Binary files a/Source/CSharpDemos/PDIDatesTest/GlobalSuppressions.cs and b/Source/CSharpDemos/PDIDatesTest/GlobalSuppressions.cs differ diff --git a/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.cs b/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.cs index e726f70..363738d 100644 --- a/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.cs +++ b/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.cs @@ -2,8 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : PDIDatesTest.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/22/2021 -// Note : Copyright 2003-2021, Eric Woodruff, All rights reserved +// Updated : 01/02/2023 +// Note : Copyright 2003-2023, Eric Woodruff, All rights reserved // // This is a console mode application that runs through a few simple configurations to test the basics in the // date utility, holiday, and recurrence classes. @@ -20,8 +20,8 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; -using System.Runtime.Serialization.Formatters.Binary; using System.Xml.Serialization; using EWSoftware.PDI; @@ -57,8 +57,8 @@ static void Main(string[] args) { try { - yearFrom = Convert.ToInt32(args[0]); - yearTo = Convert.ToInt32(args[1]); + yearFrom = Convert.ToInt32(args[0], CultureInfo.InvariantCulture); + yearTo = Convert.ToInt32(args[1], CultureInfo.InvariantCulture); if(yearFrom < 1) yearFrom = 1; @@ -547,7 +547,7 @@ static void Main(string[] args) Console.WriteLine("Holidays saved to Holidays.xml"); } -#if NETFramework +#if NETFRAMEWORK // The SOAP formatter is only supported on the full .NET Framework // SOAP using(var fs = new FileStream("Holidays.soap", FileMode.Create)) @@ -555,19 +555,20 @@ static void Main(string[] args) var sf = new System.Runtime.Serialization.Formatters.Soap.SoapFormatter(); // SOAP doesn't support generics directly so use an array - sf.Serialize(fs, holidays.ToArray()); + holidays = new HolidayCollection((Holiday[])sf.Deserialize(fs)); Console.WriteLine("Holidays saved to Holidays.soap"); } -#endif + // Binary using(var fs = new FileStream("Holidays.bin", FileMode.Create)) { - BinaryFormatter bf = new BinaryFormatter(); + var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); bf.Serialize(fs, holidays); Console.WriteLine("Holidays saved to Holidays.bin\n"); } +#endif } catch(Exception ex) { @@ -595,7 +596,7 @@ static void Main(string[] args) Console.WriteLine("Holidays retrieved from Holidays.xml"); } -#if NETFramework +#if NETFRAMEWORK // SOAP using(var fs = new FileStream("Holidays.soap", FileMode.Open)) { @@ -606,15 +607,16 @@ static void Main(string[] args) Console.WriteLine("Holidays retrieved from Holidays.soap"); } -#endif + // Binary using(var fs = new FileStream("Holidays.bin", FileMode.Open)) { - BinaryFormatter bf = new BinaryFormatter(); + var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); holidays = (HolidayCollection)bf.Deserialize(fs); Console.WriteLine("Holidays retrieved from Holidays.bin\n"); } +#endif } catch(Exception ex) { @@ -713,7 +715,7 @@ static void Main(string[] args) Console.WriteLine("Recurrence saved to Recurrence.xml"); } -#if NETFramework +#if NETFRAMEWORK // SOAP using(var fs = new FileStream("Recurrence.soap", FileMode.Create)) { @@ -722,15 +724,16 @@ static void Main(string[] args) Console.WriteLine("Recurrence saved to Recurrence.soap"); } -#endif + // Binary using(var fs = new FileStream("Recurrence.bin", FileMode.Create)) { - BinaryFormatter bf = new BinaryFormatter(); + var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); bf.Serialize(fs, rRecur); Console.WriteLine("Recurrence saved to Recurrence.bin\n"); } +#endif } catch(Exception ex) { @@ -758,7 +761,7 @@ static void Main(string[] args) Console.WriteLine("Recurrence restored from Recurrence.xml"); } -#if NETFramework +#if NETFRAMEWORK // SOAP using(var fs = new FileStream("Recurrence.soap", FileMode.Open)) { @@ -767,15 +770,16 @@ static void Main(string[] args) Console.WriteLine("Recurrence retrieved from Recurrence.soap"); } -#endif + // Binary using(var fs = new FileStream("Recurrence.bin", FileMode.Open)) { - BinaryFormatter bf = new BinaryFormatter(); + var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); rRecur = (Recurrence)bf.Deserialize(fs); Console.WriteLine("Recurrence retrieved from Recurrence.bin\n"); } +#endif } catch(Exception ex) { diff --git a/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.csproj b/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.csproj index 9d61061..130174a 100644 --- a/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.csproj +++ b/Source/CSharpDemos/PDIDatesTest/PDIDatesTest.csproj @@ -1,8 +1,8 @@ - + Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute PDIDatesTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault @@ -24,4 +24,7 @@ + + + diff --git a/Source/CSharpDemos/PDIParserTest/GlobalSuppressions.cs b/Source/CSharpDemos/PDIParserTest/GlobalSuppressions.cs new file mode 100644 index 0000000..a7b5327 --- /dev/null +++ b/Source/CSharpDemos/PDIParserTest/GlobalSuppressions.cs @@ -0,0 +1,8 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:PDIParserTest.PDIParserTest.Main(System.String[])")] diff --git a/Source/CSharpDemos/PDIParserTest/PDIParserTest.csproj b/Source/CSharpDemos/PDIParserTest/PDIParserTest.csproj index e2b6e6e..ca8c068 100644 --- a/Source/CSharpDemos/PDIParserTest/PDIParserTest.csproj +++ b/Source/CSharpDemos/PDIParserTest/PDIParserTest.csproj @@ -1,8 +1,8 @@ - + Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute PDIParserTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault diff --git a/Source/CSharpDemos/PDIWebDemoCS/Web.config b/Source/CSharpDemos/PDIWebDemoCS/Web.config index 230def3..028459a 100644 --- a/Source/CSharpDemos/PDIWebDemoCS/Web.config +++ b/Source/CSharpDemos/PDIWebDemoCS/Web.config @@ -24,7 +24,7 @@ - + diff --git a/Source/CSharpDemos/PDIWinFormsTest/EventRecurTestForm.cs b/Source/CSharpDemos/PDIWinFormsTest/EventRecurTestForm.cs index 3db106a..a577c1c 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/EventRecurTestForm.cs +++ b/Source/CSharpDemos/PDIWinFormsTest/EventRecurTestForm.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : EventRecurTestForm.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/27/2014 -// Note : Copyright 2003-2014, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2003-2023, Eric Woodruff, All rights reserved // // This is a simple demonstration used to test the event recurrence generation features of the calendar classes // @@ -76,14 +75,14 @@ private void EventRecurTestForm_Load(object sender, EventArgs e) dtpStartDate.Value = dtDate; dtpEndDate.Value = dtDate.AddMonths(3); - txtCalendar.Text = String.Format( + txtCalendar.Text = String.Format(CultureInfo.InvariantCulture, "BEGIN:VEVENT\r\n" + "DTSTART:{0}\r\n" + "DTEND:{1}\r\n" + "RRULE:FREQ=DAILY;COUNT=10;INTERVAL=5\r\n" + "END:VEVENT\r\n", - dtDate.AddHours(9).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal), - dtDate.AddHours(10).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal)); + dtDate.AddHours(9).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal, CultureInfo.InvariantCulture), + dtDate.AddHours(10).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal, CultureInfo.InvariantCulture)); } /// @@ -114,7 +113,7 @@ private void btnTest_Click(object sender, EventArgs e) lblCount.Text = null; // Wrap it in VCALENDAR tags and parse it - calendar = String.Format("BEGIN:VCALENDAR\nVERSION:2.0\n{0}\nEND:VCALENDAR", txtCalendar.Text); + calendar = $"BEGIN:VCALENDAR\nVERSION:2.0\n{txtCalendar.Text}\nEND:VCALENDAR"; VCalendar cal = VCalendarParser.ParseFromString(calendar); @@ -146,9 +145,9 @@ private void btnTest_Click(object sender, EventArgs e) lbDates.Items.Clear(); this.Cursor = Cursors.WaitCursor; - start = System.Environment.TickCount; + start = Environment.TickCount; instances = ro.InstancesBetween(dtpStartDate.Value, dtpEndDate.Value, chkInLocalTime.Checked); - elapsed = (System.Environment.TickCount - start) / 1000.0; + elapsed = (Environment.TickCount - start) / 1000.0; cal.Dispose(); @@ -158,9 +157,8 @@ private void btnTest_Click(object sender, EventArgs e) // and whether or not the component has a Time Zone ID specified. foreach(DateTimeInstance dti in instances) { - lbDates.Items.Add(String.Format("{0:G} {1} to {2:G} {3} ({4})", dti.StartDateTime, - dti.AbbreviatedStartTimeZoneName, dti.EndDateTime, dti.AbbreviatedEndTimeZoneName, - dti.Duration.ToDescription())); + lbDates.Items.Add($"{dti.StartDateTime:G} {dti.AbbreviatedStartTimeZoneName} to " + + $"{dti.EndDateTime:G} {dti.AbbreviatedEndTimeZoneName} ({dti.Duration.ToDescription()})"); if(lbDates.Items.Count > 5000) { @@ -177,8 +175,8 @@ private void btnTest_Click(object sender, EventArgs e) "the two date/time text boxes at the top of the form and the calendar item date/time " + "properties to make sure that they do overlap"); - lblCount.Text += String.Format("Found {0:N0} instances in {1:N2} seconds ({2:N2} instances/second)", - instances.Count, elapsed, instances.Count / elapsed); + lblCount.Text += $"Found {instances.Count:N0} instances in {elapsed:N2} seconds " + + $"({instances.Count / elapsed:N2} instances/second)"; } catch(Exception ex) { diff --git a/Source/CSharpDemos/PDIWinFormsTest/GlobalSuppressions.cs b/Source/CSharpDemos/PDIWinFormsTest/GlobalSuppressions.cs index d5b1630..20418a9 100644 Binary files a/Source/CSharpDemos/PDIWinFormsTest/GlobalSuppressions.cs and b/Source/CSharpDemos/PDIWinFormsTest/GlobalSuppressions.cs differ diff --git a/Source/CSharpDemos/PDIWinFormsTest/HolidayTestForm.cs b/Source/CSharpDemos/PDIWinFormsTest/HolidayTestForm.cs index 189d050..07d5082 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/HolidayTestForm.cs +++ b/Source/CSharpDemos/PDIWinFormsTest/HolidayTestForm.cs @@ -131,8 +131,10 @@ private void btnEaster_Click(object sender, EventArgs e) if(rbJulian.Checked) em = EasterMethod.Julian; else + { if(rbOrthodox.Checked) em = EasterMethod.Orthodox; + } // Adjust years as necessary based on the method if(em != EasterMethod.Julian) @@ -172,7 +174,7 @@ private void btnEaster_Click(object sender, EventArgs e) // Create the grid view's data source List items = new List(); - desc = String.Format("Easter ({0})", em.ToString()); + desc = $"Easter ({em})"; while(fromYear <= toYear) items.Add(new ListItem(DateUtils.EasterSunday(fromYear++, em), desc)); diff --git a/Source/CSharpDemos/PDIWinFormsTest/PDIWinFormsTest.csproj b/Source/CSharpDemos/PDIWinFormsTest/PDIWinFormsTest.csproj index 339c601..062c9f8 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/PDIWinFormsTest.csproj +++ b/Source/CSharpDemos/PDIWinFormsTest/PDIWinFormsTest.csproj @@ -1,241 +1,26 @@ - - + - Local - 8.0.50727 - 2.0 - {011CC2DB-A5AE-4788-AF84-C4C1A8CDF10A} - Debug - AnyCPU - App.ico - - - PDIWinFormsTest - PDIWinFormsTest.snk - JScript - Grid - IE50 - false WinExe - PDIWinFormsTest - OnBuildSuccess - - - - - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - ..\..\EWSPDIDemos.ruleset - false - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + PDIWinFormsTest.snk true + true + AllEnabledByDefault - - app.manifest - - - - System - - - System.Data - - - System.Design - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Properties\AssemblyInfoShared.cs - - - Form - - - AboutDlg.cs - - - - Code - - - Form - - - EventRecurTestForm.cs - - - Form - - - HolidayTestForm.cs - - - Form - - - MainForm.cs - - - Form - - - RRuleTestForm.cs - - - Code - - - Form - - - VTimeZoneTestForm.cs - - - AboutDlg.cs - Designer - - - EventRecurTestForm.cs - Designer - - - HolidayTestForm.cs - Designer - - - MainForm.cs - Designer - - - RRuleTestForm.cs - Designer - - - VTimeZoneTestForm.cs - Designer - - - - - - - - - + - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + + + - - - {5eda55cb-e991-4c50-93cb-149d7c4d498c} - EWSoftware.PDI.Data - - - {af3e8bed-a706-4c25-8379-2882641a221a} - EWSoftware.PDI.Windows.Forms - - - {024821de-3508-476a-97e7-441334a1b2df} - EWSoftware.PDI - - - - - - - - - \ No newline at end of file diff --git a/Source/CSharpDemos/PDIWinFormsTest/Properties/AssemblyInfo.cs b/Source/CSharpDemos/PDIWinFormsTest/Properties/AssemblyInfo.cs index fa8dff3..9d15746 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/Properties/AssemblyInfo.cs +++ b/Source/CSharpDemos/PDIWinFormsTest/Properties/AssemblyInfo.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/29/2014 -// Note : Copyright 2004-2014, Eric Woodruff, All rights reserved -// Compiler: Microsoft Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // PDI Windows Forms demo assembly attributes // diff --git a/Source/CSharpDemos/PDIWinFormsTest/RRuleTestForm.cs b/Source/CSharpDemos/PDIWinFormsTest/RRuleTestForm.cs index f0cd291..dbccd14 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/RRuleTestForm.cs +++ b/Source/CSharpDemos/PDIWinFormsTest/RRuleTestForm.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : RRuleTestForm.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/23/2018 -// Note : Copyright 2003-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2003-2023, Eric Woodruff, All rights reserved // // This is a simple demonstration used to test the recurrence engine which encapsulates the iCalendar 2.0 RRULE // feature set. It is separate from the other PDI calendar classes so that you can use the recurrence engine @@ -48,7 +47,7 @@ public RRuleTestForm() { InitializeComponent(); - lblCount.Text = String.Format(lblCount.Text, DateTime.Today.AddMonths(1)); + lblCount.Text = String.Format(CultureInfo.CurrentCulture, lblCount.Text, DateTime.Today.AddMonths(1)); // Set the short date/long time pattern based on the current culture lbDates.FormatString = dtpStartDate.CustomFormat = @@ -110,8 +109,7 @@ private void btnTest_Click(object sender, EventArgs e) // DateTimeCollection is bindable so we can assign it as the list box's data source lbDates.DataSource = dc; - lblCount.Text += String.Format("Found {0:N0} instances in {1:N2} seconds ({2:N2} instances/second)", - count, elapsed, count / elapsed); + lblCount.Text += $"Found {count:N0} instances in {elapsed:N2} seconds ({count / elapsed:N2} instances/second)"; } catch(Exception ex) { diff --git a/Source/CSharpDemos/PDIWinFormsTest/VTimeZoneTestForm.cs b/Source/CSharpDemos/PDIWinFormsTest/VTimeZoneTestForm.cs index ec0d649..9c0b60b 100644 --- a/Source/CSharpDemos/PDIWinFormsTest/VTimeZoneTestForm.cs +++ b/Source/CSharpDemos/PDIWinFormsTest/VTimeZoneTestForm.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : VTimeZoneTestForm.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/2/2014 -// Note : Copyright 2003-2014, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2003-2023, Eric Woodruff, All rights reserved // // This is a simple demonstration used to test the EWSoftware PDI time zone classes and methods. This // demonstration depends on the time zone information present in the Windows registry. @@ -120,16 +119,16 @@ private void UpdateTimes(object sender, EventArgs e) DateTimeInstance dti = VCalendar.TimeZoneTimeToLocalTime(dt, vtzSource.TimeZoneId.Value); - lblLocalTime.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName); + lblLocalTime.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}"; dti = VCalendar.LocalTimeToTimeZoneTime(dti.StartDateTime, vtzSource.TimeZoneId.Value); - lblLocalBackToSource.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName); + lblLocalBackToSource.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}"; dti = VCalendar.TimeZoneToTimeZone(dt, vtzSource.TimeZoneId.Value, vtzDest.TimeZoneId.Value); - lblDestTime.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName); + lblDestTime.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}"; dti = VCalendar.TimeZoneToTimeZone(dti.StartDateTime, vtzDest.TimeZoneId.Value, vtzSource.TimeZoneId.Value); - lblDestBackToSource.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName); + lblDestBackToSource.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}"; } /// @@ -171,7 +170,7 @@ private void btnSaveTZs_Click(object sender, EventArgs e) } catch(Exception ex) { - string errorMsg = String.Format("Unable to save time zone info:\n{0}", ex.Message); + string errorMsg = $"Unable to save time zone info:\n{ex.Message}"; if(ex.InnerException != null) { diff --git a/Source/CSharpDemos/RFC2445RecurTest/RFC2445RecurTest.csproj b/Source/CSharpDemos/RFC2445RecurTest/RFC2445RecurTest.csproj index de30596..5df1d83 100644 --- a/Source/CSharpDemos/RFC2445RecurTest/RFC2445RecurTest.csproj +++ b/Source/CSharpDemos/RFC2445RecurTest/RFC2445RecurTest.csproj @@ -1,8 +1,8 @@ - + Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute RFC2445RecurTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault diff --git a/Source/CSharpDemos/vCardBrowser/GlobalSuppressions.cs b/Source/CSharpDemos/vCardBrowser/GlobalSuppressions.cs index 77d161e..7df620f 100644 Binary files a/Source/CSharpDemos/vCardBrowser/GlobalSuppressions.cs and b/Source/CSharpDemos/vCardBrowser/GlobalSuppressions.cs differ diff --git a/Source/CSharpDemos/vCardBrowser/PhotoControl.cs b/Source/CSharpDemos/vCardBrowser/PhotoControl.cs index 8748e12..fe9906d 100644 --- a/Source/CSharpDemos/vCardBrowser/PhotoControl.cs +++ b/Source/CSharpDemos/vCardBrowser/PhotoControl.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : PhotoControl.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/23/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a vCard's photo and logo information. It's nothing elaborate but does let you edit the // properties fairly well. @@ -25,7 +24,6 @@ using System.ComponentModel; using System.Drawing; using System.IO; -using System.Net; using System.Windows.Forms; namespace vCardBrowser @@ -56,8 +54,6 @@ public string ImageFilename get => txtFilename.Text; set { - Stream s = null; - // We probably should also check that the image type is supported and set the image type combo // box too, but this is a demo, so I'm going to leave it for a future enhancement once I get all // the other demos done. @@ -70,38 +66,48 @@ public string ImageFilename value.StartsWith("https:", StringComparison.OrdinalIgnoreCase) || value.StartsWith("file:", StringComparison.OrdinalIgnoreCase))) { +#if NETFRAMEWORK try { - if(value.StartsWith("http:", StringComparison.OrdinalIgnoreCase) || - value.StartsWith("https:", StringComparison.OrdinalIgnoreCase)) - { - HttpWebRequest wrq = (HttpWebRequest)WebRequest.Create(new Uri(value)); + System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072; - WebResponse wrsp = wrq.GetResponse(); - s = wrsp.GetResponseStream(); - } - else - if(value.StartsWith("file:", StringComparison.OrdinalIgnoreCase)) + var wrq = System.Net.WebRequest.Create(new Uri(value)); + + using(var wrsp = wrq.GetResponse()) + using(var s = wrsp.GetResponseStream()) { - FileWebRequest frq = (FileWebRequest)WebRequest.Create(new Uri(value)); + bmImage.Dispose(); + bmImage = new Bitmap(s); + } + } + catch + { + // Ignore it, just create a blank image + bmImage = new Bitmap(1, 1); + } +#else + try + { + byte[] imageBytes; - WebResponse frsp = frq.GetResponse(); - s = frsp.GetResponseStream(); + using(var c = new System.Net.Http.HttpClient()) + { + imageBytes = c.GetByteArrayAsync(new Uri(value)).Result; } bmImage.Dispose(); - bmImage = new Bitmap(s); + + using(var ms = new MemoryStream(imageBytes)) + { + bmImage = new Bitmap(ms); + } } catch { // Ignore it, just create a blank image bmImage = new Bitmap(1, 1); } - finally - { - if(s != null) - s.Close(); - } +#endif } else { @@ -154,9 +160,9 @@ public bool IsInline get => chkInline.Checked; set => chkInline.Checked = value; } - #endregion +#endregion - #region Constructor +#region Constructor //===================================================================== /// @@ -168,9 +174,9 @@ public PhotoControl() bmImage = new Bitmap(1, 1); } - #endregion +#endregion - #region Helper methods +#region Helper methods //===================================================================== /// @@ -212,9 +218,9 @@ public byte[] GetImageBytes() return ms.ToArray(); } } - #endregion +#endregion - #region Event handlers +#region Event handlers //===================================================================== /// @@ -267,6 +273,6 @@ private void btnLoad_Click(object sender, EventArgs e) } } } - #endregion +#endregion } } diff --git a/Source/CSharpDemos/vCardBrowser/Properties/AssemblyInfo.cs b/Source/CSharpDemos/vCardBrowser/Properties/AssemblyInfo.cs index 74180da..9b72c16 100644 --- a/Source/CSharpDemos/vCardBrowser/Properties/AssemblyInfo.cs +++ b/Source/CSharpDemos/vCardBrowser/Properties/AssemblyInfo.cs @@ -2,9 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 12/29/2014 -// Note : Copyright 2004-2014, Eric Woodruff, All rights reserved -// Compiler: Microsoft Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // vCard Browser demo assembly attributes // diff --git a/Source/CSharpDemos/vCardBrowser/Properties/Resources.Designer.cs b/Source/CSharpDemos/vCardBrowser/Properties/Resources.Designer.cs deleted file mode 100644 index 4d099ee..0000000 --- a/Source/CSharpDemos/vCardBrowser/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace vCardBrowser.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("vCardBrowser.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Source/CSharpDemos/vCardBrowser/Properties/Resources.resx b/Source/CSharpDemos/vCardBrowser/Properties/Resources.resx deleted file mode 100644 index 1af7de1..0000000 --- a/Source/CSharpDemos/vCardBrowser/Properties/Resources.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Source/CSharpDemos/vCardBrowser/VCardBrowserForm.cs b/Source/CSharpDemos/vCardBrowser/VCardBrowserForm.cs index 0898d41..1871ad5 100644 --- a/Source/CSharpDemos/vCardBrowser/VCardBrowserForm.cs +++ b/Source/CSharpDemos/vCardBrowser/VCardBrowserForm.cs @@ -217,7 +217,7 @@ private void miOpen_Click(object sender, EventArgs e) } catch(Exception ex) { - string error = String.Format("Unable to load vCards:\n{0}", ex.Message); + string error = $"Unable to load vCards:\n{ex.Message}"; if(ex.InnerException != null) { @@ -280,7 +280,7 @@ private void miSave_Click(object sender, EventArgs e) } catch(Exception ex) { - string error = String.Format("Unable to save vCards:\n{0}", ex.Message); + string error = $"Unable to save vCards:\n{ex.Message}"; if(ex.InnerException != null) { diff --git a/Source/CSharpDemos/vCardBrowser/VCardPropertiesDlg.cs b/Source/CSharpDemos/vCardBrowser/VCardPropertiesDlg.cs index 839e8d6..df49029 100644 --- a/Source/CSharpDemos/vCardBrowser/VCardPropertiesDlg.cs +++ b/Source/CSharpDemos/vCardBrowser/VCardPropertiesDlg.cs @@ -2,8 +2,8 @@ // System : EWSoftware PDI Demonstration Applications // File : VCardPropertiesDlg.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 07/24/2020 -// Note : Copyright 2004-2020, Eric Woodruff, All rights reserved +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This is used to edit a vCard's properties. It supports most of the common properties of the vCard including // photo, logo, and sound. @@ -95,12 +95,15 @@ private void cboVersion_SelectedIndexChanged(object sender, EventArgs e) /// The event parameters private void btnFind_Click(object sender, EventArgs e) { - string url = String.Format("https://www.google.com/maps/place/{0},{1}", txtLatitude.Text, - txtLongitude.Text); + string url = $"https://www.google.com/maps/place/{txtLatitude.Text},{txtLongitude.Text}"; try { - System.Diagnostics.Process.Start(url); + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo + { + FileName = url, + UseShellExecute = true, + }); } catch(Exception ex) { @@ -179,6 +182,9 @@ private void VCardPropertiesDlg_Closing(object sender, CancelEventArgs e) /// The vCard from which to get the settings public void SetValues(VCard vCard) { + if(vCard == null) + throw new ArgumentNullException(nameof(vCard)); + // Enable or disable fields based on the version cboVersion.SelectedIndex = (vCard.Version == SpecificationVersions.vCard21) ? 0 : (vCard.Version == SpecificationVersions.vCard30) ? 1 : 2; @@ -186,7 +192,7 @@ public void SetValues(VCard vCard) // General properties txtUniqueId.Text = vCard.UniqueId.Value; txtClass.Text = vCard.Classification.Value; - txtLastRevised.Text = vCard.LastRevision.DateTimeValue.ToString("G"); + txtLastRevised.Text = vCard.LastRevision.DateTimeValue.ToString("G", CultureInfo.CurrentCulture); // Name properties txtLastName.Text = vCard.Name.FamilyName; @@ -235,8 +241,8 @@ public void SetValues(VCard vCard) } txtTimeZone.Text = vCard.TimeZone.Value; - txtLatitude.Text = vCard.GeographicPosition.Latitude.ToString(); - txtLongitude.Text = vCard.GeographicPosition.Longitude.ToString(); + txtLatitude.Text = vCard.GeographicPosition.Latitude.ToString(CultureInfo.CurrentCulture); + txtLongitude.Text = vCard.GeographicPosition.Longitude.ToString(CultureInfo.CurrentCulture); // We'll only edit the first one if(vCard.Urls.Count != 0) @@ -260,6 +266,7 @@ public void SetValues(VCard vCard) // Logo if(vCard.Logo.Value != null) + { if(vCard.Logo.ValueLocation == ValLocValue.Binary) { ucLogo.SetImageBytes(vCard.Logo.GetImageBytes()); @@ -267,6 +274,7 @@ public void SetValues(VCard vCard) } else ucLogo.ImageFilename = vCard.Logo.Value; + } ucLogo.ImageType = vCard.Logo.ImageType; } @@ -277,6 +285,9 @@ public void SetValues(VCard vCard) /// The vCard in which the settings are updated public void GetValues(VCard vCard) { + if(vCard == null) + throw new ArgumentNullException(nameof(vCard)); + // Set the version based on the one selected vCard.Version = (cboVersion.SelectedIndex == 0) ? SpecificationVersions.vCard21 : (cboVersion.SelectedIndex == 1) ? SpecificationVersions.vCard30 : SpecificationVersions.vCard40; diff --git a/Source/CSharpDemos/vCardBrowser/vCardBrowser.csproj b/Source/CSharpDemos/vCardBrowser/vCardBrowser.csproj index e34fcf8..9b224fa 100644 --- a/Source/CSharpDemos/vCardBrowser/vCardBrowser.csproj +++ b/Source/CSharpDemos/vCardBrowser/vCardBrowser.csproj @@ -1,267 +1,30 @@ - - + - Local - 8.0.50727 - 2.0 - {AC9020EB-63D3-4515-A868-8D290356FBE5} - Debug - AnyCPU - App.ico - - - vCardBrowser - vCardBrowser.snk - JScript - Grid - IE50 - false WinExe - vCardBrowser - OnBuildSuccess - - - - - - - 3.5 - v4.7.2 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - false - ..\..\EWSPDIDemos.ruleset - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + vCardBrowser.snk true - - - app.manifest + true + AllEnabledByDefault - - System - - - System.Data - - - System.Drawing - - - System.Web - - - System.Windows.Forms - - - System.XML - + - - Properties\AssemblyInfoShared.cs - - - Form - - - AboutDlg.cs - - - UserControl - - - AddressControl.cs - - - - Code - - - UserControl - - - EMailControl.cs - - - UserControl - - - LabelControl.cs - - - UserControl - - - PhoneControl.cs - - - UserControl - - - PhotoControl.cs - - - True - True - Resources.resx - - - Form - - - VCardBrowserForm.cs - - - Form - - - VCardPropertiesDlg.cs - - - AboutDlg.cs - Designer - - - AddressControl.cs - Designer - - - EMailControl.cs - Designer - - - LabelControl.cs - Designer - - - PhoneControl.cs - Designer - - - PhotoControl.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - - - VCardBrowserForm.cs - Designer - - - VCardPropertiesDlg.cs - Designer - - + + + - - + + + - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - {5eda55cb-e991-4c50-93cb-149d7c4d498c} - EWSoftware.PDI.Data - - - {af3e8bed-a706-4c25-8379-2882641a221a} - EWSoftware.PDI.Windows.Forms - - - {024821de-3508-476a-97e7-441334a1b2df} - EWSoftware.PDI - - - - - - - - - \ No newline at end of file diff --git a/Source/EWSPDI.ruleset b/Source/EWSPDI.ruleset deleted file mode 100644 index bdf20b3..0000000 --- a/Source/EWSPDI.ruleset +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/EWSPDI.sln b/Source/EWSPDI.sln index 1bf2aaf..8f06223 100644 --- a/Source/EWSPDI.sln +++ b/Source/EWSPDI.sln @@ -1,12 +1,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2002 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5282D624-0EA3-4F39-939A-E5DFB8EAF3A8}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig Common.vsspell = Common.vsspell - EWSPDI.ruleset = EWSPDI.ruleset EWSPDI.sln.vsspell = EWSPDI.sln.vsspell EndProjectSection EndProject @@ -18,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EWSoftware.PDI.Web.Controls EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EWSoftware.PDI.Windows.Forms", "EWSPDIWinForms\EWSoftware.PDI.Windows.Forms.csproj", "{7A46908F-DB3F-4F75-B6D8-529E27E3B045}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EWSoftware.PDI.WinForms.Design", "EWSPDIWinForms\EWSoftware.PDI.WinForms.Design.csproj", "{DBD186A2-8160-4BF3-92D4-61BF262F0CA2}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,8 +39,6 @@ Global {7A46908F-DB3F-4F75-B6D8-529E27E3B045}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A46908F-DB3F-4F75-B6D8-529E27E3B045}.Release|Any CPU.ActiveCfg = Release|Any CPU {7A46908F-DB3F-4F75-B6D8-529E27E3B045}.Release|Any CPU.Build.0 = Release|Any CPU - {DBD186A2-8160-4BF3-92D4-61BF262F0CA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DBD186A2-8160-4BF3-92D4-61BF262F0CA2}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Source/EWSPDI/EWSoftware.PDI.csproj b/Source/EWSPDI/EWSoftware.PDI.csproj index cf56947..d8fac04 100644 --- a/Source/EWSPDI/EWSoftware.PDI.csproj +++ b/Source/EWSPDI/EWSoftware.PDI.csproj @@ -7,10 +7,10 @@ Eric Woodruff EWSoftware Personal Data Interchange Library EWSoftware PDI Library - Copyright (c) 2003-2021, Eric Woodruff, All Rights Reserved + Copyright (c) 2003-2023, Eric Woodruff, All Rights Reserved en - 2021.11.23.0 - 21.11.23.0 + 2023.1.2.0 + 23.1.2.0 This library contains the core set of useful Personal Data Interchange (PDI) and date utility classes for .NET applications. They can be used for calculating holiday dates, recurrences, etc. See the project website for the code, a help file, and demos. Eric Woodruff https://raw.githubusercontent.com/EWSoftware/PDI/master/EWSPDI.png @@ -20,15 +20,15 @@ PDI personal data interchange holiday calculation date recurrence RFC 2445 https://github.com/EWSoftware/PDI MS-PL - Targets .NET 4.0 and .NET Standard 2.0 and later + Targets .NET Framework 4.0 and later and .NET Standard 2.0 and later true False False False False ..\EWSPDI.snk - ..\EWSPDI.ruleset - false + true + AllEnabledByDefault pdbonly true diff --git a/Source/EWSPDI/Properties/AssemblyInfoShared.cs b/Source/EWSPDI/Properties/AssemblyInfoShared.cs index 87631c5..6d803dc 100644 --- a/Source/EWSPDI/Properties/AssemblyInfoShared.cs +++ b/Source/EWSPDI/Properties/AssemblyInfoShared.cs @@ -2,8 +2,8 @@ // System : Personal Data Interchange Classes // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/23/2021 -// Note : Copyright 2004-2021, Eric Woodruff, All rights reserved +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // PDI library common assembly attributes // @@ -56,10 +56,10 @@ // // This is used to set the assembly file version. This will change with each new release. MSIs only support a // Major value between 0 and 255 so we drop the century from the year on this one. -[assembly: AssemblyFileVersion("21.11.23.0")] +[assembly: AssemblyFileVersion("23.1.2.0")] // Common product version // // This may contain additional text to indicate Alpha or Beta states. The version number will always match the // file version above but includes the century on the year. -[assembly: AssemblyInformationalVersion("2021.11.23.0")] +[assembly: AssemblyInformationalVersion("2023.1.2.0")] diff --git a/Source/EWSPDIData/EWSoftware.PDI.Data.csproj b/Source/EWSPDIData/EWSoftware.PDI.Data.csproj index 0359e58..a22f5d1 100644 --- a/Source/EWSPDIData/EWSoftware.PDI.Data.csproj +++ b/Source/EWSPDIData/EWSoftware.PDI.Data.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net40 @@ -7,10 +7,10 @@ Eric Woodruff EWSoftware Personal Data Interchange Library EWSoftware PDI Data Library - Copyright (c) 2003-2021, Eric Woodruff, All Rights Reserved + Copyright (c) 2003-2023, Eric Woodruff, All Rights Reserved en - 2021.11.23.0 - 21.11.23.0 + 2023.1.2.0 + 23.1.2.0 This library contains classes used to create and consume vCard, vCalendar, and iCalendar files used to exchange contact and appointment information between applications such as Microsoft Outlook. See the project website for the code, a help file, and demos. Eric Woodruff https://raw.githubusercontent.com/EWSoftware/PDI/master/EWSPDI.png @@ -20,15 +20,15 @@ PDI personal data interchange vCard vCalendar iCalendar RFC 2426 2445 https://github.com/EWSoftware/PDI MS-PL - Targets .NET 4.0 and .NET Standard 2.0 and later + Targets .NET Framework 4.0 and later and .NET Standard 2.0 and later true False False False False ..\EWSPDI.snk - ..\EWSPDI.ruleset - false + true + AllEnabledByDefault pdbonly true diff --git a/Source/EWSPDIDemos.ruleset b/Source/EWSPDIDemos.ruleset deleted file mode 100644 index d223daa..0000000 --- a/Source/EWSPDIDemos.ruleset +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/EWSPDIWeb/EWSoftware.PDI.Web.Controls.csproj b/Source/EWSPDIWeb/EWSoftware.PDI.Web.Controls.csproj index 8972719..d9de735 100644 --- a/Source/EWSPDIWeb/EWSoftware.PDI.Web.Controls.csproj +++ b/Source/EWSPDIWeb/EWSoftware.PDI.Web.Controls.csproj @@ -1,4 +1,4 @@ - + net40 @@ -7,10 +7,10 @@ Eric Woodruff EWSoftware Personal Data Interchange Library EWSoftware PDI Web Controls Library - Copyright (c) 2003-2021, Eric Woodruff, All Rights Reserved + Copyright (c) 2003-2023, Eric Woodruff, All Rights Reserved en - 2021.11.23.0 - 21.11.23.0 + 2023.1.2.0 + 23.1.2.0 This library contains some web controls that can be used to edit recurrence settings. See the project website for the code, a help file, and demos. Eric Woodruff https://raw.githubusercontent.com/EWSoftware/PDI/master/EWSPDI.png @@ -20,15 +20,15 @@ PDI personal data interchange web controls recurrence RFC 2445 https://github.com/EWSoftware/PDI MS-PL - Targets .NET 4.0 and later + Targets .NET Framework 4.0 and later (Windows platform only) true False False False False ..\EWSPDI.snk - ..\EWSPDI.ruleset - false + true + AllEnabledByDefault pdbonly true diff --git a/Source/EWSPDIWinForms/EWSoftware.PDI.WinForms.Design.csproj b/Source/EWSPDIWinForms/EWSoftware.PDI.WinForms.Design.csproj deleted file mode 100644 index 16ca3a3..0000000 --- a/Source/EWSPDIWinForms/EWSoftware.PDI.WinForms.Design.csproj +++ /dev/null @@ -1,308 +0,0 @@ - - - - Local - 8.0.50727 - 2.0 - {DBD186A2-8160-4BF3-92D4-61BF262F0CA2} - Debug - AnyCPU - - - - - EWSoftware.PDI.Windows.Forms - ..\EWSPDI.snk - JScript - Flow - IE50 - false - Library - EWSoftware.PDI.Windows.Forms - Always - - - - - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - objDesignOnly\ - - - binDesignOnly\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - ..\EWSPDI.ruleset - false - - - binDesignOnly\Release\ - false - 285212672 - false - - - TRACE - - - true - 4096 - false - - - true - false - false - false - 4 - pdbonly - prompt - false - - - true - - - - System - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Properties\AssemblyInfoShared.cs - - - UserControl - - - AdvancedPattern.cs - - - DailyPattern.cs - - - - HolidayManager.cs - - - HolidayPropertiesDlg.cs - - - HourlyPattern.cs - - - MinutelyPattern.cs - - - MonthlyPattern.cs - - - True - True - PDIWinForms.resx - - - Code - - - UserControl - - - BrowseControl.cs - - - UserControl - - - UserControl - - - Form - - - UserControl - - - Code - - - UserControl - - - UserControl - - - UserControl - - - RecurrencePattern.cs - - - Form - - - RecurrencePropertiesDlg.cs - - - UserControl - - - SecondlyPattern.cs - - - UserControl - - - WeeklyPattern.cs - - - UserControl - - - YearlyPattern.cs - - - AdvancedPattern.cs - Designer - - - - BrowseControl.cs - Designer - - - DailyPattern.cs - Designer - - - - HolidayManager.cs - Designer - - - HolidayPropertiesDlg.cs - Designer - - - HourlyPattern.cs - Designer - - - MinutelyPattern.cs - Designer - - - MonthlyPattern.cs - Designer - - - Designer - ResXFileCodeGenerator - PDIWinForms.Designer.cs - - - - RecurrencePattern.cs - Designer - - - RecurrencePropertiesDlg.cs - Designer - - - SecondlyPattern.cs - Designer - - - WeeklyPattern.cs - Designer - - - YearlyPattern.cs - Designer - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - EWSPDI.snk - - - - - {024821de-3508-476a-97e7-441334a1b2df} - EWSoftware.PDI - - - - - - - - - - \ No newline at end of file diff --git a/Source/EWSPDIWinForms/EWSoftware.PDI.Windows.Forms.csproj b/Source/EWSPDIWinForms/EWSoftware.PDI.Windows.Forms.csproj index 551024a..1abb231 100644 --- a/Source/EWSPDIWinForms/EWSoftware.PDI.Windows.Forms.csproj +++ b/Source/EWSPDIWinForms/EWSoftware.PDI.Windows.Forms.csproj @@ -1,17 +1,17 @@ - + - net40 + net6.0-windows;net40 true True true Eric Woodruff EWSoftware Personal Data Interchange Library EWSoftware PDI Windows Forms Control Library - Copyright (c) 2003-2021, Eric Woodruff, All Rights Reserved + Copyright (c) 2003-2023, Eric Woodruff, All Rights Reserved en - 2021.11.23.0 - 21.11.23.0 + 2023.1.2.0 + 23.1.2.0 This library contains some Windows Forms controls that can be used to edit holiday calculation settings and to edit recurrence settings. See the project website for the code, a help file, and demos. Eric Woodruff https://raw.githubusercontent.com/EWSoftware/PDI/master/EWSPDI.png @@ -21,15 +21,15 @@ PDI personal data interchange Windows Forms controls recurrence RFC 2445 https://github.com/EWSoftware/PDI MS-PL - Targets .NET 4.0 and later + Targets .NET Framework 4.0 and later and .NET 6.0 and later (Windows platform only) true False False False False ..\EWSPDI.snk - ..\EWSPDI.ruleset - false + true + AllEnabledByDefault pdbonly true @@ -72,7 +72,4 @@ - - - diff --git a/Source/EWSPDIWinForms/GlobalSuppressions.cs b/Source/EWSPDIWinForms/GlobalSuppressions.cs index f436174..85a310e 100644 Binary files a/Source/EWSPDIWinForms/GlobalSuppressions.cs and b/Source/EWSPDIWinForms/GlobalSuppressions.cs differ diff --git a/Source/EWSPDIWinForms/HolidayManager.cs b/Source/EWSPDIWinForms/HolidayManager.cs index f3569fe..8f384d7 100644 --- a/Source/EWSPDIWinForms/HolidayManager.cs +++ b/Source/EWSPDIWinForms/HolidayManager.cs @@ -2,9 +2,8 @@ // System : EWSoftware.PDI Windows Forms Controls // File : HolidayManager.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/22/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Microsoft Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // This file contains a user controls that can be used to manage a set of holidays in a HolidayCollection // @@ -25,6 +24,7 @@ using System.ComponentModel; using System.IO; using System.Windows.Forms; +using System.Xml; using System.Xml.Serialization; namespace EWSoftware.PDI.Windows.Forms @@ -248,7 +248,11 @@ private void btnLoad_Click(object sender, System.EventArgs e) using(FileStream fs = new FileStream(dlg.FileName, FileMode.Open)) { XmlSerializer xs = new XmlSerializer(typeof(HolidayCollection)); - holidays = (HolidayCollection)xs.Deserialize(fs); + + using(var rdr = XmlReader.Create(fs)) + { + holidays = (HolidayCollection)xs.Deserialize(rdr); + } } this.LoadHolidayList(); diff --git a/Source/EWSPDIWinForms/Properties/AssemblyInfo.cs b/Source/EWSPDIWinForms/Properties/AssemblyInfo.cs index 7ad490a..f452d41 100644 --- a/Source/EWSPDIWinForms/Properties/AssemblyInfo.cs +++ b/Source/EWSPDIWinForms/Properties/AssemblyInfo.cs @@ -2,9 +2,8 @@ // System : EWSoftware.PDI Windows Forms Controls // File : AssemblyInfo.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 11/18/2018 -// Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -// Compiler: Microsoft Visual C# +// Updated : 01/02/2023 +// Note : Copyright 2004-2023, Eric Woodruff, All rights reserved // // Windows forms controls that are used in conjunction with the EWSoftware.PDI classes // @@ -23,4 +22,8 @@ // General assembly information [assembly: AssemblyTitle("EWSoftware.PDI Windows Forms Controls")] +#if NET6_0_OR_GREATER +[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")] +#endif + // See AssemblyInfoShared.cs for the shared attributes common to all projects in the solution diff --git a/Source/VBNetDemos.sln b/Source/VBNetDemos.sln index f825746..059b00e 100644 --- a/Source/VBNetDemos.sln +++ b/Source/VBNetDemos.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2002 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PDIWinFormsTest", "VBNetDemos\PDIWinFormsTest\PDIWinFormsTest.vbproj", "{32B39562-144C-4272-9251-1FC72D7D4303}" EndProject @@ -12,7 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig Common.vsspell = Common.vsspell - EWSPDIDemos.ruleset = EWSPDIDemos.ruleset VBNetDemos.sln.vsspell = VBNetDemos.sln.vsspell EndProjectSection EndProject diff --git a/Source/VBNetDemos/CalendarBrowser/AttachmentsControl.vb b/Source/VBNetDemos/CalendarBrowser/AttachmentsControl.vb index 3e3c08b..ede4d2c 100644 --- a/Source/VBNetDemos/CalendarBrowser/AttachmentsControl.vb +++ b/Source/VBNetDemos/CalendarBrowser/AttachmentsControl.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : AttachmentsControl.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/05/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a calendar object's attachment properties ' @@ -29,7 +28,7 @@ Imports EWSoftware.PDI.Properties Public Partial Class AttachmentsControl Inherits System.Windows.Forms.UserControl - Private attach As AttachPropertyCollection + Private ReadOnly attach As AttachPropertyCollection Public Sub New() MyBase.New() @@ -65,9 +64,9 @@ Public Partial Class AttachmentsControl For Each a In attach If a.ValueLocation = ValLocValue.Binary Then - desc = String.Format("Inline - {0}", a.FormatType) + desc = $"Inline - {a.FormatType}" Else - desc = String.Format("External - {0}, {1}", a.FormatType, a.Value) + desc = $"External - {a.FormatType}, {a.Value}" End If lbAttachments.Items.Add(desc) @@ -87,8 +86,8 @@ Public Partial Class AttachmentsControl ''' ''' The attachments collection to update. Public Sub GetValues(attachments As AttachPropertyCollection) - attachments.Clear() - attachments.CloneRange(attach) + attachments?.Clear() + attachments?.CloneRange(attach) End Sub ''' @@ -159,7 +158,7 @@ Public Partial Class AttachmentsControl If chkInline.Checked = False Then a.ValueLocation = ValLocValue.Uri a.Value = txtFilename.Text - desc = String.Format("External - {0}, {1}", a.FormatType, a.Value) + desc = $"External - {a.FormatType}, {a.Value}" Else Using fs As New FileStream(txtFilename.Text, FileMode.Open, FileAccess.Read) Dim byData As Byte() = New Byte(CType(fs.Length - 1, Integer)) {} @@ -169,15 +168,14 @@ Public Partial Class AttachmentsControl a.SetAttachmentBytes(byData) End Using - desc = String.Format("Inline - {0}", a.FormatType) + desc = $"Inline - {a.FormatType}" End If attach.Add(a) lbAttachments.Items.Add(desc) Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to add attachment:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to add attachment:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message & Environment.NewLine @@ -248,8 +246,7 @@ Public Partial Class AttachmentsControl End Using Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to save attachment:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to save attachment:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message + Environment.NewLine diff --git a/Source/VBNetDemos/CalendarBrowser/CalendarBrowser.vbproj b/Source/VBNetDemos/CalendarBrowser/CalendarBrowser.vbproj index ffac5c8..643a3b0 100644 --- a/Source/VBNetDemos/CalendarBrowser/CalendarBrowser.vbproj +++ b/Source/VBNetDemos/CalendarBrowser/CalendarBrowser.vbproj @@ -1,314 +1,30 @@ - - + - Local - 8.0.50727 - 2.0 - {45A94A5D-36E8-41CC-A013-88B44A97F5E3} - Debug - AnyCPU - App.ico - - - CalendarBrowser - CalendarBrowser.snk - None - JScript - Grid - IE50 - false WinExe - Binary - On - On - CalendarBrowser - CalendarBrowser.CalendarBrowserForm - - - WindowsFormsWithCustomSubMain - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\ - - - 285212672 - - - - - true - true - true - false - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - ..\..\EWSPDIDemos.ruleset - false - - - bin\ - - - 285212672 - - - - - false - true - false - true - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - none - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + CalendarBrowser.snk true + true + AllEnabledByDefault - - app.manifest - - - - System - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - - - - - - - - TimeZoneRegInfo.vb - Code - - - AboutDlg.vb - - - Form - - - AlarmControl.vb - - - UserControl - - - AttachmentsControl.vb - - - UserControl - - - AttendeeControl.vb - - - UserControl - - - CalendarBrowserForm.vb - - - Form - - - CalendarObjectDlg.vb - - - Form - - - FreeBusyControl.vb - - - UserControl - - - - True - Application.myapp - - - - - ObservanceRuleControl.vb - - - UserControl - - - RecurrenceControl.vb - - - UserControl - - - RequestStatusControl.vb - - - UserControl - - - TimeZoneListDlg.vb - - - Form - - - VFreeBusyDlg.vb - - - Form - - - VTimeZoneDlg.vb - - - Form - - - AboutDlg.vb - Designer - - - AlarmControl.vb - Designer - - - AttachmentsControl.vb - Designer - - - AttendeeControl.vb - Designer - - - CalendarBrowserForm.vb - Designer - - - CalendarObjectDlg.vb - Designer - - - FreeBusyControl.vb - Designer - - - ObservanceRuleControl.vb - Designer - - - RecurrenceControl.vb - Designer - - - RequestStatusControl.vb - Designer - - - TimeZoneListDlg.vb - Designer - - - VFreeBusyDlg.vb - Designer - - - VTimeZoneDlg.vb - Designer - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - + - - - + + + - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + + - - - {4d1d331e-7475-4260-b9ad-8a31848a6054} - EWSoftware.PDI.Data - - - {1e7aaf3e-6978-4c69-a2fb-916af6f77d9e} - EWSoftware.PDI.Windows.Forms - - - {e4be35a2-31c3-4be1-a257-413fb78cdd9b} - EWSoftware.PDI - - - - - - - - - \ No newline at end of file diff --git a/Source/VBNetDemos/CalendarBrowser/CalendarBrowserForm.vb b/Source/VBNetDemos/CalendarBrowser/CalendarBrowserForm.vb index 8f3cad5..145e274 100644 --- a/Source/VBNetDemos/CalendarBrowser/CalendarBrowserForm.vb +++ b/Source/VBNetDemos/CalendarBrowser/CalendarBrowserForm.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : CalendarBrowserForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/05/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is a simple demonstration application that shows how to load, save, and manage vCalendar and iCalendar ' files including how to edit the properties on the various components. @@ -39,12 +38,12 @@ Partial Public Class CalendarBrowserForm Private vCal As VCalendar ' The calendar being browsed Private wasModified As Boolean - Private sf As StringFormat + Private ReadOnly sf As StringFormat ''' ''' The main entry point for the application ''' - Shared Sub Main(Args As String()) + Shared Sub Main() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(False) Application.Run(New CalendarBrowserForm()) @@ -254,8 +253,7 @@ Partial Public Class CalendarBrowserForm lblFilename.Text = dlg.FileName Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to load calendar:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to load calendar:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message & Environment.NewLine @@ -310,8 +308,7 @@ Partial Public Class CalendarBrowserForm lblFilename.Text = dlg.FileName Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to save calendar:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to save calendar:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message & Environment.NewLine @@ -741,9 +738,9 @@ Partial Public Class CalendarBrowserForm ' Format as date or date/time and include time zone if available If startProp.ValueLocation = ValLocValue.Date Then - columnText = String.Format("{0:d} {1}", dti.StartDateTime, dti.AbbreviatedStartTimeZoneName) + columnText = $"{dti.StartDateTime:d} {dti.AbbreviatedStartTimeZoneName}" Else - columnText = String.Format("{0} {1}", dti.StartDateTime, dti.AbbreviatedStartTimeZoneName) + columnText = $"{dti.StartDateTime} {dti.AbbreviatedStartTimeZoneName}" End If Else If e.ColumnIndex = 1 Then @@ -862,7 +859,7 @@ Partial Public Class CalendarBrowserForm If summary2 Is Nothing Then summary2 = String.Empty ' For descending order, change this to compare summary 2 to summary 1 instead - Return String.Compare(summary1, summary2, StringComparison.CurrentCulture) + Return String.Compare(summary1, summary2, StringComparison.Ordinal) End If ' For descending order, change this to compare date 2 to date 1 instead diff --git a/Source/VBNetDemos/CalendarBrowser/CalendarObjectDlg.vb b/Source/VBNetDemos/CalendarBrowser/CalendarObjectDlg.vb index d82baa6..37b9101 100644 --- a/Source/VBNetDemos/CalendarBrowser/CalendarObjectDlg.vb +++ b/Source/VBNetDemos/CalendarBrowser/CalendarObjectDlg.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : CalendarObjectDlg.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/05/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a calendar object's properties (VEvent, VToDo, or a VJournal component) ' @@ -79,8 +78,8 @@ Public Partial Class CalendarObjectDlg Return End If - If MessageBox.Show(String.Format("Do you want to convert all times from the '{0}' time zone to the " & - "'{1}' time zone?", cboTimeZone.Items(timeZoneIdx), cboTimeZone.Items(cboTimeZone.SelectedIndex)), + If MessageBox.Show(String.Format(CultureInfo.CurrentCulture, "Do you want to convert all times from the " & + "'{0}' time zone to the '{1}' time zone?", cboTimeZone.Items(timeZoneIdx), cboTimeZone.Items(cboTimeZone.SelectedIndex)), "Change Time Zone", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = System.Windows.Forms.DialogResult.No Then Return End if @@ -131,11 +130,13 @@ Public Partial Class CalendarObjectDlg ''' The event parameters Private Sub btnFind_Click(sender As Object, e As System.EventArgs) _ Handles btnFind.Click - Dim url As String = String.Format("https://www.google.com/maps/place/{0},{1}", txtLatitude.Text, - txtLongitude.Text) + Dim url As String = $"https://www.google.com/maps/place/{txtLatitude.Text},{txtLongitude.Text}" Try - System.Diagnostics.Process.Start(url) + Process.Start(New ProcessStartInfo With { + .FileName = url, + .UseShellExecute = True + }) Catch ex As Exception MessageBox.Show("Unable to start web browser", "Launch Error", MessageBoxButtons.OK, @@ -225,7 +226,7 @@ Public Partial Class CalendarObjectDlg ''' The calendar object from which to get the settings Public Sub SetValues(oCal As CalendarObject) Dim timeZoneId As String = Nothing - Dim isICalendar As Boolean = (oCal.Version = SpecificationVersions.iCalendar20) + Dim isICalendar As Boolean = (oCal?.Version = SpecificationVersions.iCalendar20) ' Disable controls that aren't relevant to the vCalendar spec txtDuration.Enabled = isICalendar @@ -250,8 +251,8 @@ Public Partial Class CalendarObjectDlg ' Header txtUniqueId.Text = e.UniqueId.Value chkTransparent.Checked = e.Transparency.IsTransparent - txtCreated.Text = e.DateCreated.TimeZoneDateTime.ToString("G") - txtLastModified.Text = e.LastModified.TimeZoneDateTime.ToString("G") + txtCreated.Text = e.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) + txtLastModified.Text = e.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) txtClass.Text = e.Classification.Value udcSequence.Value = e.Sequence.SequenceNumber udcPriority.Value = e.Priority.PriorityValue @@ -315,8 +316,8 @@ Public Partial Class CalendarObjectDlg ucAlarms.BindingSource.DataSource = New VAlarmCollection().CloneRange(e.Alarms) ' Miscellaneous - txtLatitude.Text = e.GeographicPosition.Latitude.ToString() - txtLongitude.Text = e.GeographicPosition.Longitude.ToString() + txtLatitude.Text = e.GeographicPosition.Latitude.ToString(CultureInfo.CurrentCulture) + txtLongitude.Text = e.GeographicPosition.Longitude.ToString(CultureInfo.CurrentCulture) ucRequestStatus.BindingSource.DataSource = New RequestStatusPropertyCollection().CloneRange(e.RequestStatuses) @@ -339,8 +340,8 @@ Public Partial Class CalendarObjectDlg ' Header txtUniqueId.Text = td.UniqueId.Value - txtCreated.Text = td.DateCreated.TimeZoneDateTime.ToString("G") - txtLastModified.Text = td.LastModified.TimeZoneDateTime.ToString("G") + txtCreated.Text = td.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) + txtLastModified.Text = td.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) txtClass.Text = td.Classification.Value udcSequence.Value = td.Sequence.SequenceNumber udcPriority.Value = td.Priority.PriorityValue @@ -413,8 +414,8 @@ Public Partial Class CalendarObjectDlg ucAlarms.BindingSource.DataSource = New VAlarmCollection().CloneRange(td.Alarms) ' Miscellaneous - txtLatitude.Text = td.GeographicPosition.Latitude.ToString() - txtLongitude.Text = td.GeographicPosition.Longitude.ToString() + txtLatitude.Text = td.GeographicPosition.Latitude.ToString(CultureInfo.CurrentCulture) + txtLongitude.Text = td.GeographicPosition.Longitude.ToString(CultureInfo.CurrentCulture) ucRequestStatus.BindingSource.DataSource = New RequestStatusPropertyCollection().CloneRange(td.RequestStatuses) @@ -451,8 +452,8 @@ Public Partial Class CalendarObjectDlg ' Header txtUniqueId.Text = j.UniqueId.Value - txtCreated.Text = j.DateCreated.TimeZoneDateTime.ToString("G") - txtLastModified.Text = j.LastModified.TimeZoneDateTime.ToString("G") + txtCreated.Text = j.DateCreated.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) + txtLastModified.Text = j.LastModified.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture) txtClass.Text = j.Classification.Value udcSequence.Value = j.Sequence.SequenceNumber @@ -733,9 +734,9 @@ Public Partial Class CalendarObjectDlg ' Set the time zone in the object after getting all the data. The "Set" method will not modify the ' date/times like the "Apply" method does. If cboTimeZone.Enabled = True And cboTimeZone.SelectedIndex <> 0 Then - oCal.SetTimeZone(VCalendar.TimeZones(cboTimeZone.SelectedIndex - 1)) + oCal?.SetTimeZone(VCalendar.TimeZones(cboTimeZone.SelectedIndex - 1)) Else - oCal.SetTimeZone(Nothing) + oCal?.SetTimeZone(Nothing) End If End Sub diff --git a/Source/VBNetDemos/CalendarBrowser/GlobalSuppressions.vb b/Source/VBNetDemos/CalendarBrowser/GlobalSuppressions.vb index 0a434c9..b511927 100644 Binary files a/Source/VBNetDemos/CalendarBrowser/GlobalSuppressions.vb and b/Source/VBNetDemos/CalendarBrowser/GlobalSuppressions.vb differ diff --git a/Source/VBNetDemos/CalendarBrowser/My Project/AssemblyInfoShared.vb b/Source/VBNetDemos/CalendarBrowser/My Project/AssemblyInfoShared.vb index a6de9e9..3e09c96 100644 --- a/Source/VBNetDemos/CalendarBrowser/My Project/AssemblyInfoShared.vb +++ b/Source/VBNetDemos/CalendarBrowser/My Project/AssemblyInfoShared.vb @@ -2,8 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : AssemblyInfo.cs ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 11/23/2021 -' Note : Copyright 2004-2021, Eric Woodruff, All rights reserved +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' PDI library demos common assembly attributes ' @@ -50,5 +50,5 @@ Imports System.Runtime.InteropServices ' Day of release ' Revision (typically zero unless multiple releases are made on the same day) ' - - + + diff --git a/Source/VBNetDemos/CalendarBrowser/RecurrenceControl.vb b/Source/VBNetDemos/CalendarBrowser/RecurrenceControl.vb index 1f47cda..cc786a6 100644 --- a/Source/VBNetDemos/CalendarBrowser/RecurrenceControl.vb +++ b/Source/VBNetDemos/CalendarBrowser/RecurrenceControl.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : RecurrenceControl.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 11/25/2018 -' Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a recurring calendar object's recurrence rule and recurrence date properties ' @@ -32,8 +31,8 @@ Imports EWSoftware.PDI.Windows.Forms Public Partial Class RecurrenceControl Inherits System.Windows.Forms.UserControl - Private rRules As RRulePropertyCollection - Private rDates As RDatePropertyCollection + Private ReadOnly rRules As RRulePropertyCollection + Private ReadOnly rDates As RDatePropertyCollection Private ctrlEditsExceptions As Boolean Public Sub New() @@ -113,9 +112,9 @@ Public Partial Class RecurrenceControl For Each rdt In rDates If rdt.ValueLocation = ValLocValue.Date Then - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d")) + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d", CultureInfo.CurrentCulture)) Else - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G")) + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture)) End If Next @@ -131,6 +130,10 @@ Public Partial Class RecurrenceControl Dim r As RRuleProperty, edate As ExDateProperty Dim rdt, rd As RDateProperty + If ed Is Nothing + Throw New ArgumentNullException(NameOf(ed)) + End If + rRules.Clear() rDates.Clear() rRules.CloneRange(er) @@ -156,9 +159,9 @@ Public Partial Class RecurrenceControl For Each rdt In rDates If(rdt.ValueLocation = ValLocValue.Date) - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d")) + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("d", CultureInfo.CurrentCulture)) Else - lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G")) + lbRDates.Items.Add(rdt.TimeZoneDateTime.ToString("G", CultureInfo.CurrentCulture)) End If Next @@ -173,10 +176,10 @@ Public Partial Class RecurrenceControl ''' Note that the time zone ID will need to be set in the returned RDATE property collection to make ''' sure that it is consistent with the containing component. Public Sub GetValues(rr As RRulePropertyCollection, rd As RDatePropertyCollection) - rr.Clear() - rd.Clear() - rr.CloneRange(rRules) - rd.CloneRange(rDates) + rr?.Clear() + rd?.Clear() + rr?.CloneRange(rRules) + rd?.CloneRange(rDates) End Sub ''' @@ -189,9 +192,9 @@ Public Partial Class RecurrenceControl Public Sub GetValues(er As RRulePropertyCollection, ed As ExDatePropertyCollection) Dim rdate As RDateProperty, edate As ExDateProperty - er.Clear() - ed.Clear() - er.CloneRange(rRules) + er?.Clear() + ed?.Clear() + er?.CloneRange(rRules) ' Convert the RDates to ExDate format For Each rdate In rDates @@ -201,7 +204,7 @@ Public Partial Class RecurrenceControl .TimeZoneDateTime = rdate.TimeZoneDateTime } - ed.Add(edate) + ed?.Add(edate) Next End Sub @@ -225,7 +228,7 @@ Public Partial Class RecurrenceControl End If rdt.TimeZoneDateTime = dti.StartDateTime - lbRDates.Items(idx) = dti.StartDateTime.ToString("G") + lbRDates.Items(idx) = dti.StartDateTime.ToString("G", CultureInfo.CurrentCulture) End If idx += 1 @@ -335,14 +338,14 @@ Public Partial Class RecurrenceControl } rDates.Add(rdate) - lbRDates.Items.Add(dtpRDate.Value.Date.ToString("d")) + lbRDates.Items.Add(dtpRDate.Value.Date.ToString("d", CultureInfo.CurrentCulture)) Else Dim rdate As New RDateProperty With { .TimeZoneDateTime = dtpRDate.Value } rDates.Add(rdate) - lbRDates.Items.Add(dtpRDate.Value.ToString("G")) + lbRDates.Items.Add(dtpRDate.Value.ToString("G", CultureInfo.CurrentCulture)) End If Me.SetButtonStates() diff --git a/Source/VBNetDemos/CalendarBrowser/VFreeBusyDlg.vb b/Source/VBNetDemos/CalendarBrowser/VFreeBusyDlg.vb index 7d84122..b920458 100644 --- a/Source/VBNetDemos/CalendarBrowser/VFreeBusyDlg.vb +++ b/Source/VBNetDemos/CalendarBrowser/VFreeBusyDlg.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : VFreeBusyDlg.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/05/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a VFreeBusy object's properties ' @@ -79,9 +78,10 @@ Public Partial Class VFreeBusyDlg Return End If - If MessageBox.Show(String.Format("Do you want to convert all times from the '{0}' time zone to the " & - "'{1}' time zone?", cboTimeZone.Items(timeZoneIdx), cboTimeZone.Items(cboTimeZone.SelectedIndex)), - "Change Time Zone", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = System.Windows.Forms.DialogResult.No Then + If MessageBox.Show(String.Format(CultureInfo.CurrentCulture, "Do you want to convert all times from " & + "the '{0}' time zone to the '{1}' time zone?", cboTimeZone.Items(timeZoneIdx), + cboTimeZone.Items(cboTimeZone.SelectedIndex)), "Change Time Zone", MessageBoxButtons.YesNo, + MessageBoxIcon.Question) = System.Windows.Forms.DialogResult.No Then Return End If @@ -166,6 +166,10 @@ Public Partial Class VFreeBusyDlg ''' ''' The free/busy object from which to get the settings Public Sub SetValues(fb As VFreeBusy) + If fb Is Nothing + Throw New ArgumentNullException(NameOf(fb)) + End If + Dim timeZoneId As String = fb.StartDateTime.TimeZoneId txtUniqueId.Text = fb.UniqueId.Value @@ -221,6 +225,10 @@ Public Partial Class VFreeBusyDlg ''' ''' The free/busy object in which the settings are updated Public Sub GetValues(fb As VFreeBusy) + If fb Is Nothing + Throw New ArgumentNullException(NameOf(fb)) + End If + ' The unique ID is not changed fb.Organizer.Value = txtOrganizer.Text fb.Contact.Value = txtContact.Text diff --git a/Source/VBNetDemos/CalendarBrowser/VTimeZoneDlg.vb b/Source/VBNetDemos/CalendarBrowser/VTimeZoneDlg.vb index 6f23f72..cc86220 100644 --- a/Source/VBNetDemos/CalendarBrowser/VTimeZoneDlg.vb +++ b/Source/VBNetDemos/CalendarBrowser/VTimeZoneDlg.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : VTimeZoneDlg.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/05/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Microsoft VB.NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a VTimeZone object's properties ' @@ -19,6 +18,8 @@ ' 05/21/2007 EFW Converted for use with .NET 2.0 '================================================================================================================ +Imports System.Globalization + Imports EWSoftware.PDI.Objects ''' @@ -71,10 +72,14 @@ Public Partial Class VTimeZoneDlg ''' ''' The time zone object from which to get the settings Public Sub SetValues(tz As VTimeZone) + If tz Is Nothing + Throw New ArgumentNullException(NameOf(tz)) + End If + originalId = tz.TimeZoneId.Value txtTimeZoneId.Text = tz.TimeZoneId.Value txtTimeZoneUrl.Text = tz.TimeZoneUrl.Value - txtLastModified.Text = tz.LastModified.DateTimeValue.ToString("G") + txtLastModified.Text = tz.LastModified.DateTimeValue.ToString("G", CultureInfo.CurrentCulture) ' We could bind directly to the existing collection but that would modify it. To preserve the original ' items, we'll pass a copy of the collection instead. @@ -86,6 +91,10 @@ Public Partial Class VTimeZoneDlg ''' ''' The time zone object in which the settings are updated Public Sub GetValues(tz As VTimeZone) + If tz Is Nothing + Throw New ArgumentNullException(NameOf(tz)) + End If + tz.TimeZoneId.Value = txtTimeZoneId.Text tz.TimeZoneUrl.Value = txtTimeZoneUrl.Text tz.LastModified.DateTimeValue = DateTime.Now diff --git a/Source/VBNetDemos/PDIDatesTest/GlobalSuppressions.vb b/Source/VBNetDemos/PDIDatesTest/GlobalSuppressions.vb index d0a6908..695cec4 100644 Binary files a/Source/VBNetDemos/PDIDatesTest/GlobalSuppressions.vb and b/Source/VBNetDemos/PDIDatesTest/GlobalSuppressions.vb differ diff --git a/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vb b/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vb index 40218c6..22a184d 100644 --- a/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vb +++ b/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vb @@ -2,8 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : PDIDatesTest.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 11/22/2021 -' Note : Copyright 2004-2021, Eric Woodruff, All rights reserved +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is a console mode application that runs through a few simple configurations to test the basics in the ' date utility, holiday, and recurrence classes. @@ -18,8 +18,8 @@ ' 12/01/2004 EFW Created the code '================================================================================================================ +Imports System.Globalization Imports System.IO -Imports System.Runtime.Serialization.Formatters.Binary Imports System.Xml.Serialization Imports EWSoftware.PDI @@ -42,8 +42,8 @@ Module PDIDatesTest yearTo = yearFrom + 8 Else Try - yearFrom = Convert.ToInt32(args(0)) - yearTo = Convert.ToInt32(args(1)) + yearFrom = Convert.ToInt32(args(0), CultureInfo.InvariantCulture) + yearTo = Convert.ToInt32(args(1), CultureInfo.InvariantCulture) If yearFrom < 1 Then yearFrom = 1 If yearFrom > 9999 Then yearFrom = 9999 @@ -453,24 +453,24 @@ Module PDIDatesTest xs.Serialize(fs, holidays) Console.WriteLine("Holidays saved to Holidays.xml") End Using -#If NETFramework +#If NETFRAMEWORK ' The SOAP formatter is only supported on the full .NET Framework ' SOAP Using fs As New FileStream("Holidays.soap", FileMode.Create) - Dim sf As New System.Runtime.Serialization.Formatters.Soap.SoapFormatter() + Dim sf As New Runtime.Serialization.Formatters.Soap.SoapFormatter() ' SOAP doesn't support generics directly so use an array sf.Serialize(fs, holidays.ToArray()) Console.WriteLine("Holidays saved to Holidays.soap") End Using -#End If + ' Binary Using fs As New FileStream("Holidays.bin", FileMode.Create) - Dim bf As New BinaryFormatter() + Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter() bf.Serialize(fs, holidays) Console.WriteLine("Holidays saved to Holidays.bin{0}", Environment.NewLine) End Using - +#End If Catch ex As Exception Console.WriteLine("Unable to save holidays:{0}{1}", Environment.NewLine, ex.Message) @@ -486,32 +486,31 @@ Module PDIDatesTest ' Delete the collection and read it back in holidays = Nothing - - Try - ' XML +Try +' XML Using fs AS New FileStream("Holidays.xml", FileMode.Open) Dim xs As New XmlSerializer(GetType(HolidayCollection)) holidays = DirectCast(xs.Deserialize(fs), HolidayCollection) Console.WriteLine("Holidays retrieved from Holidays.xml") End Using -#If NETFramework +#If NETFRAMEWORK ' SOAP Using fs As New FileStream("Holidays.soap", FileMode.Open) - Dim sf As New System.Runtime.Serialization.Formatters.Soap.SoapFormatter() + Dim sf As New Runtime.Serialization.Formatters.Soap.SoapFormatter() ' As noted, SOAP doesn't support generics to an array is used instead holidays = New HolidayCollection(DirectCast(sf.Deserialize(fs), Holiday())) Console.WriteLine("Holidays retrieved from Holidays.soap") End Using -#End If + ' Binary Using fs As New FileStream("Holidays.bin", FileMode.Open) - Dim bf As New BinaryFormatter() + Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter() holidays = DirectCast(bf.Deserialize(fs), HolidayCollection) Console.WriteLine("Holidays retrieved from Holidays.bin{0}", Environment.NewLine) End Using - +#End If Catch ex As Exception Console.WriteLine("Unable to load holidays:{0}{1}", Environment.NewLine, ex.Message) @@ -603,21 +602,21 @@ Module PDIDatesTest xs.Serialize(fs, rRecur) Console.WriteLine("Recurrence saved to Recurrence.xml") End Using -#If NETFramework +#If NETFRAMEWORK ' SOAP Using fs As New FileStream("Recurrence.soap", FileMode.Create) - Dim sf As New System.Runtime.Serialization.Formatters.Soap.SoapFormatter() + Dim sf As New Runtime.Serialization.Formatters.Soap.SoapFormatter() sf.Serialize(fs, rRecur) Console.WriteLine("Recurrence saved to Recurrence.soap") End Using -#End If + ' Binary Using fs As New FileStream("Recurrence.bin", FileMode.Create) - Dim bf As New BinaryFormatter() + Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter() bf.Serialize(fs, rRecur) Console.WriteLine("Recurrence saved to Recurrence.bin{0}", Environment.NewLine) End Using - +#End If Catch ex As Exception Console.WriteLine("Unable to save recurrence:{0}{1}", Environment.NewLine, ex.Message) @@ -641,21 +640,21 @@ Module PDIDatesTest rRecur = DirectCast(xs.Deserialize(fs), Recurrence) Console.WriteLine("Recurrence restored from Recurrence.xml") End Using -#If NETFramework +#If NETFRAMEWORK ' SOAP Using fs As New FileStream("Recurrence.soap", FileMode.Open) - Dim sf As New System.Runtime.Serialization.Formatters.Soap.SoapFormatter() + Dim sf As New Runtime.Serialization.Formatters.Soap.SoapFormatter() rRecur = DirectCast(sf.Deserialize(fs), Recurrence) Console.WriteLine("Recurrence retrieved from Recurrence.soap") End Using -#End If + ' Binary Using fs As New FileStream("Recurrence.bin", FileMode.Open) - Dim bf As New BinaryFormatter() + Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter() rRecur = DirectCast(bf.Deserialize(fs), Recurrence) Console.WriteLine("Recurrence retrieved from Recurrence.bin{0}", Environment.NewLine) End Using - +#End If Catch ex As Exception Console.WriteLine("Unable to restore recurrence:{0}{1}", Environment.NewLine, ex.Message) diff --git a/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vbproj b/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vbproj index c7189a4..e6ba988 100644 --- a/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vbproj +++ b/Source/VBNetDemos/PDIDatesTest/PDIDatesTest.vbproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute PDIDatesTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault @@ -24,4 +24,7 @@ + + + diff --git a/Source/VBNetDemos/PDIParserTest/GlobalSuppressions.vb b/Source/VBNetDemos/PDIParserTest/GlobalSuppressions.vb new file mode 100644 index 0000000..2be96f3 --- /dev/null +++ b/Source/VBNetDemos/PDIParserTest/GlobalSuppressions.vb @@ -0,0 +1,8 @@ +' This file is used by Code Analysis to maintain SuppressMessage +' attributes that are applied to this project. +' Project-level suppressions either have no target or are given +' a specific target and scoped to a namespace, type, member, etc. + +Imports System.Diagnostics.CodeAnalysis + + diff --git a/Source/VBNetDemos/PDIParserTest/PDIParserTest.vbproj b/Source/VBNetDemos/PDIParserTest/PDIParserTest.vbproj index 3d43b44..30279bf 100644 --- a/Source/VBNetDemos/PDIParserTest/PDIParserTest.vbproj +++ b/Source/VBNetDemos/PDIParserTest/PDIParserTest.vbproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute PDIParserTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault diff --git a/Source/VBNetDemos/PDIWebDemoVB/Web.config b/Source/VBNetDemos/PDIWebDemoVB/Web.config index f6b6acb..87a8909 100644 --- a/Source/VBNetDemos/PDIWebDemoVB/Web.config +++ b/Source/VBNetDemos/PDIWebDemoVB/Web.config @@ -29,7 +29,7 @@ - + diff --git a/Source/VBNetDemos/PDIWinFormsTest/EventRecurTestForm.vb b/Source/VBNetDemos/PDIWinFormsTest/EventRecurTestForm.vb index d344834..8431749 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/EventRecurTestForm.vb +++ b/Source/VBNetDemos/PDIWinFormsTest/EventRecurTestForm.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : EventRecurTestForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/02/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Visual Basic .NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is a simple demonstration used to test the event recurrence generation features of the calendar classes ' @@ -38,7 +37,7 @@ Public Partial Class EventRecurTestForm InitializeComponent() - lblCount.Text = String.Format(lblCount.Text, DateTime.Today.AddMonths(1)) + lblCount.Text = String.Format(CultureInfo.CurrentCulture, lblCount.Text, DateTime.Today.AddMonths(1)) ' Set the short date/long time pattern based on the current culture dtpStartDate.CustomFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & @@ -63,8 +62,7 @@ Public Partial Class EventRecurTestForm lblCount.Text = String.Empty ' Wrap it in VCALENDAR tags and parse it - calendar = String.Format("BEGIN:VCALENDAR{0}VERSION:2.0{0}{1}{0}END:VCALENDAR", Environment.NewLine, - txtCalendar.Text) + calendar = $"BEGIN:VCALENDAR{Environment.NewLine}VERSION:2.0{Environment.NewLine}{txtCalendar.Text}{Environment.NewLine}END:VCALENDAR" Dim cal As VCalendar = VCalendarParser.ParseFromString(calendar) @@ -110,7 +108,8 @@ Public Partial Class EventRecurTestForm ' based on the "In Local Time" parameter of the InstancesBetween() method and whether or not the ' component has a Time Zone ID specified. For Each dti As DateTimeInstance In instances - lbDates.Items.Add(String.Format("{0:d} {0:hh:mm:ss tt} {1} to {2:d} {2:hh:mm:ss tt} {3} ({4})", + lbDates.Items.Add(String.Format(CultureInfo.CurrentCulture, + "{0:d} {0:hh:mm:ss tt} {1} to {2:d} {2:hh:mm:ss tt} {3} ({4})", dti.StartDateTime, dti.AbbreviatedStartTimeZoneName, dti.EndDateTime, dti.AbbreviatedEndTimeZoneName, dti.Duration.ToDescription())) @@ -129,8 +128,8 @@ Public Partial Class EventRecurTestForm "to make sure that they do overlap") End If - lblCount.Text &= String.Format("Found {0:N0} instances in {1:N2} seconds ({2:N2} instances/second)", - instances.Count, elapsed, instances.Count / elapsed) + lblCount.Text &= $"Found {instances.Count:N0} instances in {elapsed:N2} seconds " & + "({instances.Count / elapsed:N2} instances/second)" Catch ex As Exception MessageBox.Show(ex.ToString()) @@ -159,19 +158,19 @@ Public Partial Class EventRecurTestForm cboTimeZone.SelectedIndex = 0 - Dim dtDate As DateTime = New DateTime(DateTime.Today.Year, 1, 1) + Dim dtDate As New DateTime(DateTime.Today.Year, 1, 1) cboTimeZone.SelectedIndex = 0 dtpStartDate.Value = dtDate dtpEndDate.Value = dtDate.AddMonths(3) - txtCalendar.Text = String.Format( + txtCalendar.Text = String.Format(CultureInfo.InvariantCulture, "BEGIN:VEVENT{0}" & "DTSTART:{1}{0}" & "DTEND:{2}{0}" & "RRULE:FREQ=DAILY;COUNT=10;INTERVAL=5{0}" & "END:VEVENT{0}", Environment.NewLine, - dtDate.AddHours(9).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal), - dtDate.AddHours(10).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal)) + dtDate.AddHours(9).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal, CultureInfo.InvariantCulture), + dtDate.AddHours(10).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal, CultureInfo.InvariantCulture)) End Sub ''' diff --git a/Source/VBNetDemos/PDIWinFormsTest/GlobalSuppressions.vb b/Source/VBNetDemos/PDIWinFormsTest/GlobalSuppressions.vb index c05fdf9..95c9b83 100644 Binary files a/Source/VBNetDemos/PDIWinFormsTest/GlobalSuppressions.vb and b/Source/VBNetDemos/PDIWinFormsTest/GlobalSuppressions.vb differ diff --git a/Source/VBNetDemos/PDIWinFormsTest/HolidayTestForm.vb b/Source/VBNetDemos/PDIWinFormsTest/HolidayTestForm.vb index bab1e64..2c82ee9 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/HolidayTestForm.vb +++ b/Source/VBNetDemos/PDIWinFormsTest/HolidayTestForm.vb @@ -2,8 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : HolidayTestForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 11/22/2021 -' Note : Copyright 2004-2021, Eric Woodruff, All rights reserved +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to test the various Holiday classes and the DateUtils class ' @@ -61,7 +61,7 @@ Public Partial Class HolidayTestForm ''' The event arguments Private Sub btnTestDate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnTestDate.Click - Dim hcHols As HolidayCollection = New HolidayCollection(hmHolidays.Holidays) + Dim hcHols As New HolidayCollection(hmHolidays.Holidays) If hcHols.IsHoliday(dtpTestDate.Value) = True Then MessageBox.Show("The test date is a holiday", "Found!", MessageBoxButtons.OK, @@ -80,7 +80,7 @@ Public Partial Class HolidayTestForm ''' The event arguments Private Sub btnFind_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnFind.Click - Dim holidays As HolidayCollection = New HolidayCollection(hmHolidays.Holidays) + Dim holidays As New HolidayCollection(hmHolidays.Holidays) Dim fromYear, toYear, year As Integer fromYear = CType(udcFromYear.Value, Integer) @@ -150,7 +150,7 @@ Public Partial Class HolidayTestForm ' Create the grid view's data source Dim items As New List(Of ListItem)() - desc = String.Format("Easter ({0})", em.ToString()) + desc = $"Easter ({em})" Do While fromYear <= toYear items.Add(New ListItem(DateUtils.EasterSunday(fromYear, em), desc)) diff --git a/Source/VBNetDemos/PDIWinFormsTest/MainForm.vb b/Source/VBNetDemos/PDIWinFormsTest/MainForm.vb index 6b6b713..8a2bc7b 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/MainForm.vb +++ b/Source/VBNetDemos/PDIWinFormsTest/MainForm.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : MainForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/02/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Visual Basic .NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This application is used to demonstrate various features of the EWSoftware PDI classes ' @@ -27,7 +26,7 @@ Public Partial Class MainForm ''' ''' The main entry point for the application ''' - Shared Sub Main(Args As String()) + Shared Sub Main() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(false) Application.Run(new MainForm()) diff --git a/Source/VBNetDemos/PDIWinFormsTest/PDIWinFormsTest.vbproj b/Source/VBNetDemos/PDIWinFormsTest/PDIWinFormsTest.vbproj index ff231a5..bedf666 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/PDIWinFormsTest.vbproj +++ b/Source/VBNetDemos/PDIWinFormsTest/PDIWinFormsTest.vbproj @@ -1,246 +1,30 @@ - - + - Local - 8.0.50727 - 2.0 - {32B39562-144C-4272-9251-1FC72D7D4303} - Debug - AnyCPU - App.ico - - - PDIWinFormsTest - PDIWinFormsTest.snk - None - JScript - Grid - IE50 - false WinExe - Binary - On - On - PDIWinFormsTest - PDIWinFormsTest.MainForm - - - WindowsFormsWithCustomSubMain - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\ - - - 285212672 - - - - - true - true - true - false - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - ..\..\EWSPDIDemos.ruleset - false - - - bin\ - - - 285212672 - - - - - false - true - false - true - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - none - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + PDIWinFormsTest.snk true + true + AllEnabledByDefault - - app.manifest - - - - System - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - - + - - My Project\AssemblyInfoShared.vb - - - AboutDlg.vb - - - Form - - - - Code - - - EventRecurTestForm.vb - - - Form - - - HolidayTestForm.vb - - - Form - - - MainForm.vb - - - Form - - - True - Application.myapp - - - RRuleTestForm.vb - - - Form - - - Code - - - VTimeZoneTestForm.vb - - - Form - - - AboutDlg.vb - Designer - - - EventRecurTestForm.vb - Designer - - - HolidayTestForm.vb - Designer - - - MainForm.vb - Designer - - - RRuleTestForm.vb - Designer - - - VTimeZoneTestForm.vb - Designer - - - - MyApplicationCodeGenerator - Application.Designer.vb - + + + - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - {4d1d331e-7475-4260-b9ad-8a31848a6054} - EWSoftware.PDI.Data - - - {1e7aaf3e-6978-4c69-a2fb-916af6f77d9e} - EWSoftware.PDI.Windows.Forms - - - {e4be35a2-31c3-4be1-a257-413fb78cdd9b} - EWSoftware.PDI - - - - - - - - - + + + + \ No newline at end of file diff --git a/Source/VBNetDemos/PDIWinFormsTest/RRuleTestForm.vb b/Source/VBNetDemos/PDIWinFormsTest/RRuleTestForm.vb index 923e349..b1e13e4 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/RRuleTestForm.vb +++ b/Source/VBNetDemos/PDIWinFormsTest/RRuleTestForm.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : RRuleTestForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 11/25/2018 -' Note : Copyright 2004-2018, Eric Woodruff, All rights reserved -' Compiler: Visual Basic .NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is a simple demonstration used to test the recurrence engine which encapsulates the iCalendar 2.0 RRULE ' feature set. It is separate from the other PDI calendar classes so that you can use the recurrence engine @@ -42,7 +41,7 @@ Public Partial Class RRuleTestForm InitializeComponent() - lblCount.Text = String.Format(lblCount.Text, DateTime.Today.AddMonths(1)) + lblCount.Text = String.Format(CultureInfo.CurrentCulture, lblCount.Text, DateTime.Today.AddMonths(1)) ' Set the short date/long time pattern based on the current culture dtpStartDate.CustomFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & @@ -97,8 +96,7 @@ Public Partial Class RRuleTestForm ' DateTimeCollection is bindable so we can assign it as the list box's data source lbDates.DataSource = dc - lblCount.Text &= String.Format("Found {0:N0} instances in {1:N2} seconds ({2:N2} instances/second)", - count, elapsed, count / elapsed) + lblCount.Text &= $"Found {count:N0} instances in {elapsed:N2} seconds ({count / elapsed:N2} instances/second)" Catch ex As Exception MessageBox.Show(ex.ToString()) diff --git a/Source/VBNetDemos/PDIWinFormsTest/VTimeZoneTestForm.vb b/Source/VBNetDemos/PDIWinFormsTest/VTimeZoneTestForm.vb index 5199c26..490e7a0 100644 --- a/Source/VBNetDemos/PDIWinFormsTest/VTimeZoneTestForm.vb +++ b/Source/VBNetDemos/PDIWinFormsTest/VTimeZoneTestForm.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : VTimeZoneTestForm.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/02/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Visual Basic .NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is a simple demonstration used to test the EWSoftware PDI time zone classes and methods. This ' demonstration depends on the time zone information present in the Windows registry. @@ -77,16 +76,16 @@ Public Partial Class VTimeZoneTestForm Dim dti As DateTimeInstance = VCalendar.TimeZoneTimeToLocalTime(dt, vtzSource.TimeZoneId.Value) - lblLocalTime.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName) + lblLocalTime.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}" dti = VCalendar.LocalTimeToTimeZoneTime(dti.StartDateTime, vtzSource.TimeZoneId.Value) - lblLocalBackToSource.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName) + lblLocalBackToSource.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}" dti = VCalendar.TimeZoneToTimeZone(dt, vtzSource.TimeZoneId.Value, vtzDest.TimeZoneId.Value) - lblDestTime.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName) + lblDestTime.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}" dti = VCalendar.TimeZoneToTimeZone(dti.StartDateTime, vtzDest.TimeZoneId.Value, vtzSource.TimeZoneId.Value) - lblDestBackToSource.Text = String.Format("{0} {1}", dti.StartDateTime, dti.StartTimeZoneName) + lblDestBackToSource.Text = $"{dti.StartDateTime} {dti.StartTimeZoneName}" End Sub ''' @@ -165,8 +164,7 @@ Public Partial Class VTimeZoneTestForm End Using Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to save time zone info:{0}{1}", - Environment.NewLine, ex.Message) + Dim errorMsg As String = $"Unable to save time zone info:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message & Environment.NewLine diff --git a/Source/VBNetDemos/RFC2445RecurTest/RFC2445RecurTest.vbproj b/Source/VBNetDemos/RFC2445RecurTest/RFC2445RecurTest.vbproj index 81e5ae9..f288751 100644 --- a/Source/VBNetDemos/RFC2445RecurTest/RFC2445RecurTest.vbproj +++ b/Source/VBNetDemos/RFC2445RecurTest/RFC2445RecurTest.vbproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0;net40 False False False @@ -12,8 +12,8 @@ ProductAttribute RFC2445RecurTest.snk true - ..\..\EWSPDIDemos.ruleset - false + true + AllEnabledByDefault diff --git a/Source/VBNetDemos/vCardBrowser/AddressControl.vb b/Source/VBNetDemos/vCardBrowser/AddressControl.vb index ac9d2df..0cc361f 100644 --- a/Source/VBNetDemos/vCardBrowser/AddressControl.vb +++ b/Source/VBNetDemos/vCardBrowser/AddressControl.vb @@ -187,17 +187,17 @@ Public Partial Class AddressControl If txtStreetAddress.Text.Length <> 0 Then sb.Append(HttpUtility.UrlEncode(txtStreetAddress.Text)) - sb.Append("+") + sb.Append("+"c) End If If txtLocality.Text.Length <> 0 Then sb.Append(HttpUtility.UrlEncode(txtLocality.Text)) - sb.Append("+") + sb.Append("+"c) End If If txtRegion.Text.Length <> 0 Then sb.Append(HttpUtility.UrlEncode(txtRegion.Text)) - sb.Append("+") + sb.Append("+"c) End If If txtPostalCode.Text.Length <> 0 Then diff --git a/Source/VBNetDemos/vCardBrowser/GlobalSuppressions.vb b/Source/VBNetDemos/vCardBrowser/GlobalSuppressions.vb index d4ac677..9107b5d 100644 Binary files a/Source/VBNetDemos/vCardBrowser/GlobalSuppressions.vb and b/Source/VBNetDemos/vCardBrowser/GlobalSuppressions.vb differ diff --git a/Source/VBNetDemos/vCardBrowser/PhotoControl.vb b/Source/VBNetDemos/vCardBrowser/PhotoControl.vb index 3aac5c0..54ffe53 100644 --- a/Source/VBNetDemos/vCardBrowser/PhotoControl.vb +++ b/Source/VBNetDemos/vCardBrowser/PhotoControl.vb @@ -2,9 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : PhotoControl.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 01/02/2015 -' Note : Copyright 2004-2015, Eric Woodruff, All rights reserved -' Compiler: Visual Basic .NET +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a vCard's photo and logo information. It's nothing elaborate but does let you edit the ' properties fairly well. @@ -23,7 +22,6 @@ Imports System.ComponentModel Imports System.IO -Imports System.Net ''' ''' A user control for editing vCard photo and logo properties @@ -52,8 +50,6 @@ Public Partial Class PhotoControl Return txtFilename.Text End Get Set - Dim s As Stream = Nothing - ' We probably should also check that the image type is supported and set the image type combo box ' too, but this is a demo, so I'm going to leave it for a future enhancement once I get all the other ' demos done. @@ -65,29 +61,40 @@ Public Partial Class PhotoControl If Not (Value Is Nothing) AndAlso (Value.StartsWith("http:", StringComparison.OrdinalIgnoreCase) OrElse Value.StartsWith("https:", StringComparison.OrdinalIgnoreCase) OrElse Value.StartsWith("file:", StringComparison.OrdinalIgnoreCase)) Then +#If NETFRAMEWORK Try - If Value.StartsWith("http:", StringComparison.OrdinalIgnoreCase) = True Or _ - Value.StartsWith("https:", StringComparison.OrdinalIgnoreCase) = True Then - Dim wrq As HttpWebRequest = DirectCast(WebRequest.Create(New Uri(Value)), HttpWebRequest) + Net.ServicePointManager.SecurityProtocol = 3072 - Dim wrsp As WebResponse = wrq.GetResponse() - s = wrsp.GetResponseStream() - Else - If Value.StartsWith("file:", StringComparison.OrdinalIgnoreCase) = True Then - Dim frq As FileWebRequest = DirectCast(WebRequest.Create(New Uri(Value)), FileWebRequest) - Dim frsp As WebResponse = frq.GetResponse() - s = frsp.GetResponseStream() - End If - End If + Dim wrq = Net.WebRequest.Create(New Uri(value)) + + Using wrsp = wrq.GetResponse() + Using s = wrsp.GetResponseStream() + bmImage.Dispose() + bmImage = New Bitmap(s) + End Using + End Using + Catch + ' Ignore it, just create a blank image + bmImage = new Bitmap(1, 1) + End Try +#Else + Try + Dim imageBytes As Byte() + + Using c As New System.Net.Http.HttpClient() + imageBytes = c.GetByteArrayAsync(new Uri(value)).Result + End Using bmImage.Dispose() - bmImage = New Bitmap(s) + + Using ms As New MemoryStream(imageBytes) + bmImage = new Bitmap(ms) + End Using Catch ' Ignore it, just create a blank image bmImage = New Bitmap(1, 1) - Finally - If Not (s Is Nothing) Then s.Close() End Try +#End If Else Try bmImage.Dispose() diff --git a/Source/VBNetDemos/vCardBrowser/VCardBrowserForm.vb b/Source/VBNetDemos/vCardBrowser/VCardBrowserForm.vb index 1c612e7..4ddf73c 100644 --- a/Source/VBNetDemos/vCardBrowser/VCardBrowserForm.vb +++ b/Source/VBNetDemos/vCardBrowser/VCardBrowserForm.vb @@ -22,7 +22,6 @@ Imports System.ComponentModel Imports System.Globalization Imports System.IO -Imports System.Linq Imports System.Text Imports EWSoftware.PDI.Objects @@ -47,7 +46,7 @@ Public Partial Class VCardBrowserForm ''' ''' The main entry point for the application ''' - Public Shared Sub Main(Args As String()) + Public Shared Sub Main() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(False) Application.Run(New VCardBrowserForm()) @@ -146,7 +145,7 @@ Public Partial Class VCardBrowserForm End If ' For descending order, change this to compare name 2 to name 1 instead - Return String.Compare(sortName1, sortName2, StringComparison.CurrentCulture) + Return String.Compare(sortName1, sortName2, StringComparison.Ordinal) End Function ''' @@ -212,8 +211,7 @@ Public Partial Class VCardBrowserForm lblFilename.Text = dlg.FileName Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to load vCards:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to load vCards:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) errorMsg &= ex.InnerException.Message & Environment.NewLine @@ -267,8 +265,7 @@ Public Partial Class VCardBrowserForm wasModified = False Catch ex As Exception - Dim errorMsg As String = String.Format("Unable to save vCards:{0}{1}", Environment.NewLine, - ex.Message) + Dim errorMsg As String = $"Unable to save vCards:{Environment.NewLine}{ex.Message}" If Not (ex.InnerException Is Nothing) Then errorMsg &= ex.InnerException.Message + Environment.NewLine @@ -511,7 +508,7 @@ Public Partial Class VCardBrowserForm foreColor = e.CellStyle.ForeColor End If - Using b As SolidBrush = New SolidBrush(foreColor) + Using b As New SolidBrush(foreColor) e.Graphics.DrawString(version, e.CellStyle.Font, b, e.CellBounds, Me.sf) End Using diff --git a/Source/VBNetDemos/vCardBrowser/VCardPropertiesDlg.vb b/Source/VBNetDemos/vCardBrowser/VCardPropertiesDlg.vb index 5cf9e06..16f60e8 100644 --- a/Source/VBNetDemos/vCardBrowser/VCardPropertiesDlg.vb +++ b/Source/VBNetDemos/vCardBrowser/VCardPropertiesDlg.vb @@ -2,8 +2,8 @@ ' System : EWSoftware PDI Demonstration Applications ' File : VCardPropertiesDlg.vb ' Author : Eric Woodruff (Eric@EWoodruff.us) -' Updated : 07/24/2020 -' Note : Copyright 2004-2020, Eric Woodruff, All rights reserved +' Updated : 01/02/2023 +' Note : Copyright 2004-2023, Eric Woodruff, All rights reserved ' ' This is used to edit a vCard's information. It supports most of the common properties of the vCard including ' photo, logo, and sound. @@ -86,11 +86,13 @@ Partial Public Class VCardPropertiesDlg ''' The event parameters Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click - Dim url As String = String.Format("https://www.google.com/maps/place/{0},{1}", txtLatitude.Text, - txtLongitude.Text) + Dim url As String = $"https://www.google.com/maps/place/{txtLatitude.Text},{txtLongitude.Text}" Try - System.Diagnostics.Process.Start(url) + Process.Start(New ProcessStartInfo With { + .FileName = url, + .UseShellExecute = True + }) Catch ex As Exception MessageBox.Show("Unable to start web browser", "Launch Error", MessageBoxButtons.OK, @@ -164,6 +166,10 @@ Partial Public Class VCardPropertiesDlg ''' ''' The vCard from which to get the settings Public Sub SetValues(vCard As VCard) + If vCard Is Nothing + Throw New ArgumentNullException(NameOf(vCard)) + End If + ' Enable or disable fields based on the version If vCard.Version = SpecificationVersions.vCard21 Then cboVersion.SelectedIndex = 0 @@ -178,7 +184,7 @@ Partial Public Class VCardPropertiesDlg ' General properties txtUniqueId.Text = vCard.UniqueId.Value txtClass.Text = vCard.Classification.Value - txtLastRevised.Text = vCard.LastRevision.DateTimeValue.ToString("G") + txtLastRevised.Text = vCard.LastRevision.DateTimeValue.ToString("G", CultureInfo.CurrentCulture) ' Name properties txtLastName.Text = vCard.Name.FamilyName @@ -226,8 +232,8 @@ Partial Public Class VCardPropertiesDlg End If txtTimeZone.Text = vCard.TimeZone.Value - txtLatitude.Text = vCard.GeographicPosition.Latitude.ToString() - txtLongitude.Text = vCard.GeographicPosition.Longitude.ToString() + txtLatitude.Text = vCard.GeographicPosition.Latitude.ToString(CultureInfo.InvariantCulture) + txtLongitude.Text = vCard.GeographicPosition.Longitude.ToString(CultureInfo.InvariantCulture) ' We'll only edit the first one If vCard.Urls.Count <> 0 Then @@ -269,6 +275,10 @@ Partial Public Class VCardPropertiesDlg ''' ''' The vCard in which the settings are updated Public Sub GetValues(vCard As VCard) + If vCard Is Nothing + Throw New ArgumentNullException(NameOf(vCard)) + End If + ' Set the version based on the one selected If cboVersion.SelectedIndex = 0 Then vCard.Version = SpecificationVersions.vCard21 @@ -297,7 +307,8 @@ Partial Public Class VCardPropertiesDlg vCard.Nickname.NicknamesString = txtNickname.Text - vCard.Gender.Sex = If(cboSex.SelectedIndex = 0, Nothing, Convert.ToChar(cboSex.SelectedValue)) + vCard.Gender.Sex = If(cboSex.SelectedIndex = 0, Nothing, Convert.ToChar(cboSex.SelectedValue, + CultureInfo.InvariantCulture)) vCard.Gender.GenderIdentity = txtGenderIdentity.Text ' For the collections, we'll clear the existing items and copy the modified items from the browse control diff --git a/Source/VBNetDemos/vCardBrowser/vCardBrowser.vbproj b/Source/VBNetDemos/vCardBrowser/vCardBrowser.vbproj index c15eb48..8fbee95 100644 --- a/Source/VBNetDemos/vCardBrowser/vCardBrowser.vbproj +++ b/Source/VBNetDemos/vCardBrowser/vCardBrowser.vbproj @@ -1,266 +1,36 @@ - - + - Local - 8.0.50727 - 2.0 - {DC514DED-802F-4871-A220-661C0E697A54} - Debug - AnyCPU - App.ico - - - vCardBrowser - vCardBrowser.snk - None - JScript - Grid - IE50 - false WinExe - Binary - On - On - vCardBrowser - vCardBrowser.VCardBrowserForm - - - WindowsFormsWithCustomSubMain - - - 3.5 - v4.7.2 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\ - - - 285212672 - - - - - true - true - true - false - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - full - ..\..\EWSPDIDemos.ruleset - false - - - bin\ - - - 285212672 - - - - - false - true - false - true - false - false - false - 1 - 42016,42017,42018,42019,42032,42353,42354,42355 - none - false - - + net6.0-windows;net40 + true + False + False + False + False + False + False + ProductAttribute + vCardBrowser.snk true - - - app.manifest + true + AllEnabledByDefault + System.Windows.Forms=False,Microsoft.VisualBasic=True,System=True,System.Collections=True,System.Collections.Generic=True,System.Diagnostics=True,System.Linq=True,System.Xml.Linq=True,System.Threading.Tasks=True,vCardBrowser=True - - System - - - System.Data - - - System.Drawing - - - System.Web - - - System.Windows.Forms - + - - - - + + + - - - My Project\AssemblyInfoShared.vb - - - AboutDlg.vb - - - Form - - - AddressControl.vb - - - UserControl - - - - Code - - - EMailControl.vb - - - UserControl - - - LabelControl.vb - - - UserControl - - - True - Application.myapp - - - PhoneControl.vb - - - UserControl - - - PhotoControl.vb - - - UserControl - - - VCardBrowserForm.vb - - - Form - - - VCardPropertiesDlg.vb - - - Form - - - AboutDlg.vb - Designer - - - AddressControl.vb - Designer - - - EMailControl.vb - Designer - - - LabelControl.vb - Designer - - - PhoneControl.vb - Designer - - - PhotoControl.vb - Designer - - - VCardBrowserForm.vb - Designer - - - VCardPropertiesDlg.vb - Designer - - - - MyApplicationCodeGenerator - Application.Designer.vb - + + + + - + + - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - {4d1d331e-7475-4260-b9ad-8a31848a6054} - EWSoftware.PDI.Data - - - {1e7aaf3e-6978-4c69-a2fb-916af6f77d9e} - EWSoftware.PDI.Windows.Forms - - - {e4be35a2-31c3-4be1-a257-413fb78cdd9b} - EWSoftware.PDI - - - - - - - - - \ No newline at end of file