Skip to content

Commit 1807073

Browse files
committed
Updates
* Upgrade to .NET Framework 4.5.2 New * .NET Core 3.0 support
1 parent 6c89450 commit 1807073

File tree

4 files changed

+47
-40
lines changed

4 files changed

+47
-40
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ XML extension functions and serializer.
276276

277277
[![Nuget Version](https://img.shields.io/nuget/v/Simplify.Windows.Forms)](https://www.nuget.org/packages/Simplify.Windows.Forms)
278278
[![Nuget Download](https://img.shields.io/nuget/dt/Simplify.Windows.Forms)](https://www.nuget.org/packages/Simplify.Windows.Forms)
279-
![Platform](https://img.shields.io/badge/platform-.NET%204.5-lightgrey)
279+
![Platform](https://img.shields.io/badge/platform-.NET%20Core%203.0%20%7C%20.NET%204.5.2-lightgrey)
280280
[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/nuget/Simplify.Windows.Forms)](https://libraries.io/nuget/Simplify.Windows.Forms)
281281

282282
`Simplify.Windows.Forms` controls set.

src/Simplify.Windows.Forms/ControlsValidator.cs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,47 @@ public ControlsValidator(Control resultStatusControl, params Control[] checkItem
2424
_checkItems = checkItems;
2525
}
2626

27+
/// <summary>
28+
/// Enable items validation
29+
/// </summary>
30+
public void EnableValidation()
31+
{
32+
_validationEnabled = true;
33+
34+
foreach (var item in _checkItems)
35+
{
36+
var castItemComboBox = item as ComboBox;
37+
38+
// Special validation for ComboBox controls
39+
if (castItemComboBox != null)
40+
{
41+
if (castItemComboBox.Items.Count == 0 && castItemComboBox.DropDownStyle == ComboBoxStyle.DropDownList)
42+
castItemComboBox.Enabled = false;
43+
else
44+
castItemComboBox.SelectedIndexChanged += OnItemCheckEvent;
45+
}
46+
else
47+
item.TextChanged += OnItemCheckEvent;
48+
}
49+
50+
ValidateItems();
51+
}
52+
2753
private void ValidateItems()
2854
{
29-
foreach(var item in _checkItems)
55+
foreach (var item in _checkItems)
3056
{
3157
var castItemComboBox = item as ComboBox;
3258

33-
if(castItemComboBox != null)
59+
if (castItemComboBox != null)
3460
{
35-
if(castItemComboBox.DropDownStyle == ComboBoxStyle.DropDownList && castItemComboBox.SelectedIndex == -1)
61+
if (castItemComboBox.DropDownStyle == ComboBoxStyle.DropDownList && castItemComboBox.SelectedIndex == -1)
3662
{
3763
_resultStatusControl.Enabled = false;
3864
return;
3965
}
4066
}
41-
else if(item.Text.Length == 0)
67+
else if (item.Text.Length == 0)
4268
{
4369
_resultStatusControl.Enabled = false;
4470
return;
@@ -50,34 +76,8 @@ private void ValidateItems()
5076

5177
private void OnItemCheckEvent(object sender, EventArgs e)
5278
{
53-
if(_validationEnabled)
79+
if (_validationEnabled)
5480
ValidateItems();
5581
}
56-
57-
/// <summary>
58-
/// Elable items validation
59-
/// </summary>
60-
public void EnableValidation()
61-
{
62-
_validationEnabled = true;
63-
64-
foreach(var item in _checkItems)
65-
{
66-
var castItemComboBox = item as ComboBox;
67-
68-
// Special validation for ComboBox controls
69-
if(castItemComboBox != null)
70-
{
71-
if(castItemComboBox.Items.Count == 0 && castItemComboBox.DropDownStyle == ComboBoxStyle.DropDownList)
72-
castItemComboBox.Enabled = false;
73-
else
74-
castItemComboBox.SelectedIndexChanged += OnItemCheckEvent;
75-
}
76-
else
77-
item.TextChanged += OnItemCheckEvent;
78-
}
79-
80-
ValidateItems();
81-
}
8282
}
83-
}
83+
}

src/Simplify.Windows.Forms/MessageBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Simplify.Windows.Forms
77
/// Provides easy message box showing for windows desktop applications
88
/// </summary>
99
public class MessageBox
10-
{
10+
{
1111
/// <summary>
1212
/// Shows the message box
1313
/// </summary>
@@ -28,6 +28,6 @@ public static DialogResult ShowMessageBox(string text, MessageBoxIcon icon = Mes
2828
public static DialogResult ShowStMessageBox(string stringTableRecordName, MessageBoxIcon icon = MessageBoxIcon.Information, MessageBoxButtons buttons = MessageBoxButtons.OK)
2929
{
3030
return ShowMessageBox(StringTable.Entry[stringTableRecordName], icon, buttons);
31-
}
31+
}
3232
}
33-
}
33+
}
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22
<PropertyGroup>
3-
<TargetFrameworks>net45</TargetFrameworks>
3+
<TargetFrameworks>net452;netcoreapp3.0</TargetFrameworks>
4+
<UseWindowsForms>true</UseWindowsForms>
45
<Authors>Alexander Krylkov</Authors>
56
<Product>Simplify</Product>
67
<Description>System.Windows.Forms additional controls</Description>
78
<Copyright>Licensed under LGPL</Copyright>
8-
<Version>1.0.1</Version>
9+
<Version>1.1</Version>
910
<PackageProjectUrl>https://github.com/SimplifyNet/Simplify</PackageProjectUrl>
1011
<PackageIconUrl>https://raw.githubusercontent.com/SimplifyNet/Images/master/Logo.png</PackageIconUrl>
1112
<RepositoryUrl>https://github.com/SimplifyNet/Simplify/tree/master/src/Simplify.Pipelines</RepositoryUrl>
1213
<RepositoryType>GIT</RepositoryType>
1314
<PackageTags>.NET pipelines</PackageTags>
1415
<PackageReleaseNotes>
16+
Updates
17+
* Upgrade to .NET Framework 4.5.2
18+
New
19+
* .NET Core 3.0 support
1520
</PackageReleaseNotes>
1621
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
1722
<DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.Windows.Forms.xml</DocumentationFile>
1823
</PropertyGroup>
1924
<ItemGroup>
20-
<PackageReference Include="Simplify.Resources" Version="1.0.0" />
25+
<PackageReference Include="Simplify.Resources" Version="1.0.1" />
26+
</ItemGroup>
27+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
2128
<Reference Include="System.Windows.Forms" />
2229
</ItemGroup>
2330
</Project>

0 commit comments

Comments
 (0)