Reset settings when creating instance
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,1591</NoWarn>
|
||||
<DocumentationFile>Pilz.Configuration.xml</DocumentationFile>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.vb</DefaultItemExcludes>
|
||||
@@ -13,7 +13,7 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
<PropertyGroup>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Version>3.1.0</Version>
|
||||
<Version>3.1.1</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Pilz.Configuration
|
||||
|
||||
if (Activator.CreateInstance<T>() is T settingsNew)
|
||||
{
|
||||
settingsNew.Reset();
|
||||
mySettings.Add(T.Identifier, settingsNew);
|
||||
return settingsNew;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user