diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..00c0bbf --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,12 @@ + + + + netstandard2.0;net48;net8.0 + net8.0-windows + + diff --git a/ExamplesAndTests/BigCsvFileViewer/Auxiliary/PeHeaderReader.cs b/ExamplesAndTests/BigCsvFileViewer/Auxiliary/PeHeaderReader.cs index cb2bfa8..076581f 100644 --- a/ExamplesAndTests/BigCsvFileViewer/Auxiliary/PeHeaderReader.cs +++ b/ExamplesAndTests/BigCsvFileViewer/Auxiliary/PeHeaderReader.cs @@ -575,7 +575,7 @@ public DateTime TimeStamp // Add in the number of seconds since 1970/1/1 returnValue = returnValue.AddSeconds(fileHeader.TimeDateStamp); // Adjust to local timezone - returnValue += TimeZone.CurrentTimeZone.GetUtcOffset(returnValue); + returnValue = TimeZoneInfo.ConvertTimeFromUtc(returnValue, TimeZoneInfo.Local); return returnValue; } diff --git a/ExamplesAndTests/BigCsvFileViewer/BigCsvFileViewer.csproj b/ExamplesAndTests/BigCsvFileViewer/BigCsvFileViewer.csproj index 0f28c59..52c0596 100644 --- a/ExamplesAndTests/BigCsvFileViewer/BigCsvFileViewer.csproj +++ b/ExamplesAndTests/BigCsvFileViewer/BigCsvFileViewer.csproj @@ -1,35 +1,18 @@ - - + WinExe true Properties BigCsvFileViewer BigCsvFileViewer - net46 Creative Commons Swordfish Computing Pty Ltd 1.0.0 + $(WinTargetFramework) BigCsvFileViewer.ico - - - - - - - - - - - 4.0 - - - - - diff --git a/ExamplesAndTests/DGGroupSortFilterExampleConcurrent/DGGroupSortFilterExampleConcurrent.csproj b/ExamplesAndTests/DGGroupSortFilterExampleConcurrent/DGGroupSortFilterExampleConcurrent.csproj index 5cac7e8..37c90c8 100644 --- a/ExamplesAndTests/DGGroupSortFilterExampleConcurrent/DGGroupSortFilterExampleConcurrent.csproj +++ b/ExamplesAndTests/DGGroupSortFilterExampleConcurrent/DGGroupSortFilterExampleConcurrent.csproj @@ -1,10 +1,10 @@ - + WinExe - net461 true preview + $(WinTargetFramework) diff --git a/ExamplesAndTests/DGGroupSortFilterExampleNormal/DGGroupSortFilterExampleNormal.csproj b/ExamplesAndTests/DGGroupSortFilterExampleNormal/DGGroupSortFilterExampleNormal.csproj index a5efc16..7cdad89 100644 --- a/ExamplesAndTests/DGGroupSortFilterExampleNormal/DGGroupSortFilterExampleNormal.csproj +++ b/ExamplesAndTests/DGGroupSortFilterExampleNormal/DGGroupSortFilterExampleNormal.csproj @@ -1,9 +1,9 @@ - + WinExe - net461 true + $(WinTargetFramework) diff --git a/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/Auxilary/GroupSortAndFilterBehavior.cs b/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/Auxilary/GroupSortAndFilterBehavior.cs index 84fe971..3febb38 100644 --- a/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/Auxilary/GroupSortAndFilterBehavior.cs +++ b/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/Auxilary/GroupSortAndFilterBehavior.cs @@ -55,7 +55,7 @@ private void DataGrid_UserClickedOnHeaderSorting(object sender, DataGridSortingE var toRemove = SortDescriptions.Where(sd => sd.PropertyName == sortMemberPath).FirstOrDefault(); - if (toRemove == SortDescriptions.FirstOrDefault() && toRemove != null) + if (toRemove == SortDescriptions.FirstOrDefault()) { direction = toRemove.Direction == ListSortDirection.Ascending ? @@ -63,10 +63,7 @@ private void DataGrid_UserClickedOnHeaderSorting(object sender, DataGridSortingE ListSortDirection.Ascending; } - if (toRemove != null) - { - SortDescriptions.Remove(toRemove); - } + SortDescriptions.Remove(toRemove); var sortDescription = new SortDescription(sortMemberPath, direction); SortDescriptions.Insert(0, sortDescription); diff --git a/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/DataGridGroupSortFilterUltimateExample.csproj b/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/DataGridGroupSortFilterUltimateExample.csproj index 948792d..98737cf 100644 --- a/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/DataGridGroupSortFilterUltimateExample.csproj +++ b/ExamplesAndTests/DataGridGroupSortFilterUltimateExample/DataGridGroupSortFilterUltimateExample.csproj @@ -1,11 +1,11 @@ - + WinExe - net461 true Resources\Thumbs_Up.ico preview + $(WinTargetFramework) diff --git a/ExamplesAndTests/EditableDataGridTest/EditableDataGridTest.csproj b/ExamplesAndTests/EditableDataGridTest/EditableDataGridTest.csproj index 5994e52..c1c213a 100644 --- a/ExamplesAndTests/EditableDataGridTest/EditableDataGridTest.csproj +++ b/ExamplesAndTests/EditableDataGridTest/EditableDataGridTest.csproj @@ -1,9 +1,9 @@ - + WinExe - net461 true + $(WinTargetFramework) diff --git a/ExamplesAndTests/RetainedSelectionTest/RetainedSelectionTest.csproj b/ExamplesAndTests/RetainedSelectionTest/RetainedSelectionTest.csproj index 895b90e..b688355 100644 --- a/ExamplesAndTests/RetainedSelectionTest/RetainedSelectionTest.csproj +++ b/ExamplesAndTests/RetainedSelectionTest/RetainedSelectionTest.csproj @@ -2,9 +2,9 @@ WinExe - net461 true preview + $(WinTargetFramework) diff --git a/ExamplesAndTests/Swordfish.NET.Test/Swordfish.NET.Test.csproj b/ExamplesAndTests/Swordfish.NET.Test/Swordfish.NET.Test.csproj index f8754a3..ce1c175 100644 --- a/ExamplesAndTests/Swordfish.NET.Test/Swordfish.NET.Test.csproj +++ b/ExamplesAndTests/Swordfish.NET.Test/Swordfish.NET.Test.csproj @@ -1,33 +1,18 @@  - + WinExe true Properties Swordfish.NET.Test Swordfish.NET.Test - net46 Creative Commons Swordfish Computing Pty Ltd Swordfish.NET.Test Swordfish.NET.Test 1.0.0 + net48 - - - - - - - - - - 4.0 - - - - - diff --git a/ExamplesAndTests/Swordfish.NET.TestV3/Swordfish.NET.TestV3.csproj b/ExamplesAndTests/Swordfish.NET.TestV3/Swordfish.NET.TestV3.csproj index 9221579..4d52075 100644 --- a/ExamplesAndTests/Swordfish.NET.TestV3/Swordfish.NET.TestV3.csproj +++ b/ExamplesAndTests/Swordfish.NET.TestV3/Swordfish.NET.TestV3.csproj @@ -1,14 +1,14 @@  - + WinExe true - netcoreapp3.1;net451;net46 Creative Commons Swordfish Computing Pty Ltd Swordfish.NET.TestV3 Swordfish.NET.TestV3 1.0.0 + $(WinTargetFramework) diff --git a/ExamplesAndTests/Swordfish.NET.UnitTestV3/Swordfish.NET.UnitTestV3.csproj b/ExamplesAndTests/Swordfish.NET.UnitTestV3/Swordfish.NET.UnitTestV3.csproj index 8493c0f..4b443cf 100644 --- a/ExamplesAndTests/Swordfish.NET.UnitTestV3/Swordfish.NET.UnitTestV3.csproj +++ b/ExamplesAndTests/Swordfish.NET.UnitTestV3/Swordfish.NET.UnitTestV3.csproj @@ -1,7 +1,6 @@  - netcoreapp3.1;net451;net46;net8.0-windows Creative Commons Swordfish Computing Pty Ltd Swordfish.NET.TestV3 diff --git a/Swordfish.NET.Collections.sln b/Swordfish.NET.Collections.sln index 1d5f73e..ce9a814 100644 --- a/Swordfish.NET.Collections.sln +++ b/Swordfish.NET.Collections.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29926.136 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35122.118 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swordfish.NET.Collections", "Swordfish.NET.Collections\Swordfish.NET.Collections.csproj", "{F2E1680E-1B15-4CF2-BAB0-54B8C8F6ABDF}" EndProject @@ -20,6 +20,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F612E4C5-2FA3-4F69-9770-09ABCBFFF88A}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + Directory.Build.props = Directory.Build.props README.md = README.md EndProjectSection EndProject @@ -31,7 +32,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DGGroupSortFilterExampleNor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataGridGroupSortFilterUltimateExample", "ExamplesAndTests\DataGridGroupSortFilterUltimateExample\DataGridGroupSortFilterUltimateExample.csproj", "{BA119134-A2E8-4165-B38A-65EE43F6070C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RetainedSelectionTest", "ExamplesAndTests\RetainedSelectionTest\RetainedSelectionTest.csproj", "{B718F642-504D-40C9-8D62-0CD959EDC4FB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RetainedSelectionTest", "ExamplesAndTests\RetainedSelectionTest\RetainedSelectionTest.csproj", "{B718F642-504D-40C9-8D62-0CD959EDC4FB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Swordfish.NET.Collections/Auxiliary/BigRational.cs b/Swordfish.NET.Collections/Auxiliary/BigRational.cs index 3314eed..c3bf293 100644 --- a/Swordfish.NET.Collections/Auxiliary/BigRational.cs +++ b/Swordfish.NET.Collections/Auxiliary/BigRational.cs @@ -785,7 +785,6 @@ void IDeserializationCallback.OnDeserialization(Object sender) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) diff --git a/Swordfish.NET.Collections/Auxiliary/Extensions.cs b/Swordfish.NET.Collections/Auxiliary/Extensions.cs index b19d22f..2131879 100644 --- a/Swordfish.NET.Collections/Auxiliary/Extensions.cs +++ b/Swordfish.NET.Collections/Auxiliary/Extensions.cs @@ -428,15 +428,16 @@ public static IEnumerable Flatten(this IEnumerable e, Func f(c).Flatten(f)).Concat(e); } - //-------------------------------------------------------------------------------------------- - - /// - /// Perform a deep Copy of the object. - /// - /// The type of object being copied. - /// The object instance to copy. - /// The copied object. - public static T SerializableClone(this T source) +#if !NET6_0_OR_GREATER + //-------------------------------------------------------------------------------------------- + + /// + /// Perform a deep Copy of the object. + /// + /// The type of object being copied. + /// The object instance to copy. + /// The copied object. + public static T SerializableClone(this T source) { if (!source.GetType().IsSerializable) { @@ -458,10 +459,10 @@ public static T SerializableClone(this T source) return (T)formatter.Deserialize(stream); } } +#endif + //-------------------------------------------------------------------------------------------- - //-------------------------------------------------------------------------------------------- - - private static Dictionary> enumTypeToConverters = new Dictionary>(); + private static Dictionary> enumTypeToConverters = new Dictionary>(); /// /// Gets the description for the enumerated type @@ -1136,4 +1137,4 @@ public static string RemoveNewLineCharacters(this string _txt) return _txt.Replace("\n", " ").Replace("\r", ""); } } -} \ No newline at end of file +} diff --git a/Swordfish.NET.Collections/Auxiliary/PeHeaderReader.cs b/Swordfish.NET.Collections/Auxiliary/PeHeaderReader.cs index 1d9286d..43acabf 100644 --- a/Swordfish.NET.Collections/Auxiliary/PeHeaderReader.cs +++ b/Swordfish.NET.Collections/Auxiliary/PeHeaderReader.cs @@ -545,12 +545,11 @@ public DateTime TimeStamp { // Add in the number of seconds since 1970/1/1 returnValue = returnValue.AddSeconds(fileHeader.TimeDateStamp); // Adjust to local timezone - returnValue += TimeZone.CurrentTimeZone.GetUtcOffset(returnValue); + returnValue = TimeZoneInfo.ConvertTimeFromUtc(returnValue, TimeZoneInfo.Local); return returnValue; } } - #endregion Properties } } diff --git a/Swordfish.NET.Collections/ConcurrentObservableBase.cs b/Swordfish.NET.Collections/ConcurrentObservableBase.cs index 1bfb150..cadda20 100644 --- a/Swordfish.NET.Collections/ConcurrentObservableBase.cs +++ b/Swordfish.NET.Collections/ConcurrentObservableBase.cs @@ -8,27 +8,25 @@ // Last Revised: September 2012 using System; -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Linq; -using System.Text; -using System.Collections.Specialized; -using System.Threading; -using System.Windows.Threading; using System.Collections; +using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; using System.Runtime.Serialization; +using System.Threading; -namespace Swordfish.NET.Collections { +namespace Swordfish.NET.Collections +{ - /// - /// This class provides the base for concurrent collections that - /// can be bound to user interface elements - /// - /// - /// - /// - [Serializable] + /// + /// This class provides the base for concurrent collections that + /// can be bound to user interface elements + /// + /// + /// + /// + [Serializable] public abstract class ConcurrentObservableBase : IObservable, INotifyCollectionChanged, diff --git a/Swordfish.NET.Collections/Swordfish.NET.Collections.csproj b/Swordfish.NET.Collections/Swordfish.NET.Collections.csproj index 7a0f695..bf55a11 100644 --- a/Swordfish.NET.Collections/Swordfish.NET.Collections.csproj +++ b/Swordfish.NET.Collections/Swordfish.NET.Collections.csproj @@ -5,25 +5,13 @@ Properties Swordfish.NET.Collections Swordfish.NET.Collections - net451 Creative Commons Swordfish Computing Pty Ltd Swordfish.NET.CollectionsV3 Swordfish.NET.CollectionsV3 2.1.0 2.$(PointVersion) + net48;net8.0-windows + true - - - - - - - - - - - - - \ No newline at end of file diff --git a/Swordfish.NET.CollectionsV3/Auxiliary/BigRationalOld.cs b/Swordfish.NET.CollectionsV3/Auxiliary/BigRationalOld.cs index 626cfa5..64fb809 100644 --- a/Swordfish.NET.CollectionsV3/Auxiliary/BigRationalOld.cs +++ b/Swordfish.NET.CollectionsV3/Auxiliary/BigRationalOld.cs @@ -783,7 +783,6 @@ void IDeserializationCallback.OnDeserialization(Object sender) } } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) diff --git a/Swordfish.NET.CollectionsV3/Swordfish.NET.CollectionsV3.csproj b/Swordfish.NET.CollectionsV3/Swordfish.NET.CollectionsV3.csproj index 86b5b81..f54e305 100644 --- a/Swordfish.NET.CollectionsV3/Swordfish.NET.CollectionsV3.csproj +++ b/Swordfish.NET.CollectionsV3/Swordfish.NET.CollectionsV3.csproj @@ -5,15 +5,14 @@ Properties Swordfish.NET.Collections Swordfish.NET.CollectionsV3 - netstandard2.0;net451;net46 Creative Commons Swordfish Computing Pty Ltd Swordfish.NET.CollectionsV3 Swordfish.NET.CollectionsV3 - stewienj - C# library for Concurrent Observable Collection, Sorted Collection, Dictionary, and Sorted Dictionary - https://github.com/stewienj/SwordfishCollections.git - $(GITHUB_SHA) + stewienj + C# library for Concurrent Observable Collection, Sorted Collection, Dictionary, and Sorted Dictionary + https://github.com/stewienj/SwordfishCollections.git + $(GITHUB_SHA) 3.1.0 3.$(PointVersion) 5d0656ca-f966-42bd-9e74-0ec774d5ccaa