Skip to content

Commit 53ad5e2

Browse files
committed
* Upgraded to .NET Framework 4.8
* External dependencies are now NuGet packages * Code improvements
1 parent 4d14655 commit 53ad5e2

File tree

13 files changed

+80
-78
lines changed

13 files changed

+80
-78
lines changed

Advanced PortChecker/Advanced PortChecker.csproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>Advanced_PortChecker</RootNamespace>
1111
<AssemblyName>Advanced PortChecker</AssemblyName>
12-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<WarningLevel>4</WarningLevel>
@@ -44,11 +44,17 @@
4444
<ApplicationIcon>globe.ico</ApplicationIcon>
4545
</PropertyGroup>
4646
<ItemGroup>
47-
<Reference Include="Syncfusion.Shared.WPF, Version=14.4460.0.15, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
48-
<SpecificVersion>False</SpecificVersion>
47+
<Reference Include="CodeDead.UpdateManager, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
48+
<HintPath>..\packages\CodeDead.UpdateManager.1.4.4\lib\net48\CodeDead.UpdateManager.dll</HintPath>
4949
</Reference>
50-
<Reference Include="Syncfusion.Tools.WPF, Version=16.2460.0.50, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
51-
<SpecificVersion>False</SpecificVersion>
50+
<Reference Include="Syncfusion.Licensing, Version=17.1460.0.43, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
51+
<HintPath>..\packages\Syncfusion.Licensing.17.1.0.43\lib\net46\Syncfusion.Licensing.dll</HintPath>
52+
</Reference>
53+
<Reference Include="Syncfusion.Shared.WPF, Version=17.1460.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Syncfusion.Shared.WPF.17.1.0.43\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Syncfusion.Tools.WPF, Version=17.1460.0.43, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Syncfusion.Tools.WPF.17.1.0.43\lib\net46\Syncfusion.Tools.WPF.dll</HintPath>
5258
</Reference>
5359
<Reference Include="System" />
5460
<Reference Include="System.Drawing" />
@@ -57,9 +63,6 @@
5763
<RequiredTargetFramework>4.0</RequiredTargetFramework>
5864
</Reference>
5965
<Reference Include="System.Xml" />
60-
<Reference Include="UpdateManager">
61-
<HintPath>..\..\UpdateManager\UpdateManager\bin\Release\UpdateManager.dll</HintPath>
62-
</Reference>
6366
<Reference Include="WindowsBase" />
6467
<Reference Include="PresentationCore" />
6568
<Reference Include="PresentationFramework" />
@@ -121,6 +124,7 @@
121124
<Generator>ResXFileCodeGenerator</Generator>
122125
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
123126
</EmbeddedResource>
127+
<None Include="packages.config" />
124128
<None Include="Properties\Settings.settings">
125129
<Generator>SettingsSingleFileGenerator</Generator>
126130
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

Advanced PortChecker/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</sectionGroup>
77
</configSections>
88
<startup>
9-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
9+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
1010
</startup>
1111
<userSettings>
1212
<Advanced_PortChecker.Properties.Settings>

Advanced PortChecker/App.xaml.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Threading.Tasks;
5-
using System.Windows;
6-
7-
namespace Advanced_PortChecker
1+
namespace Advanced_PortChecker
82
{
93
/// <summary>
104
/// Interaction logic for App.xaml
115
/// </summary>
12-
public partial class App : Application
6+
public partial class App
137
{
8+
/// <inheritdoc />
9+
/// <summary>
10+
/// Initialize a new App
11+
/// </summary>
12+
public App()
13+
{
14+
// Enter your Syncfusion license key here
15+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY HERE");
16+
}
1417
}
1518
}

Advanced PortChecker/Classes/Objects/LvCheck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Represents the content of a ListViewItem
55
/// </summary>
6-
public class LvCheck
6+
public sealed class LvCheck
77
{
88
/// <summary>
99
/// The address that was scanned

Advanced PortChecker/Classes/Scanner/PortScanner.cs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Globalization;
43
using System.Net;
54
using System.Net.Sockets;
@@ -23,20 +22,18 @@ internal static class PortScanner
2322
/// <param name="scanOperation">The ScanInformation object containing information regarding this scan</param>
2423
/// <returns>A list of LvCheck objects containing information regarding the ports and address that were scanned</returns>
2524
// ReSharper disable once IdentifierTypo
26-
internal static List<LvCheck> CheckTCPUDP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation)
25+
internal static void CheckTCPUDP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation)
2726
{
28-
List<LvCheck> lv = new List<LvCheck>();
2927
for (int i = startPort; i <= stopPort; i++)
3028
{
3129
if (scanOperation.IsCancelled) break;
3230

33-
lv.AddRange(CheckTCP(address, i, i, timeout, scanOperation, false));
34-
lv.AddRange(CheckUDP(address, i, i, timeout, scanOperation, false));
31+
CheckTCP(address, i, i, timeout, scanOperation, false);
32+
CheckUDP(address, i, i, timeout, scanOperation, false);
3533

3634
scanOperation.Progress.Report(1);
3735
}
3836
scanOperation.ScanCompletedEvent?.Invoke();
39-
return lv;
4037
}
4138

4239
// ReSharper disable once InconsistentNaming
@@ -49,10 +46,8 @@ internal static List<LvCheck> CheckTCPUDP(string address, int startPort, int sto
4946
/// <param name="timeout">The amount of time before the connection times out</param>
5047
/// <param name="scanOperation">The ScanInformation object containing information regarding this scan</param>
5148
/// <param name="reportProgress">A boolean to represent whether this method should report the current progress or not</param>
52-
/// <returns>A list of LvCheck objects containing information regarding the ports and address that were scanned</returns>
53-
internal static List<LvCheck> CheckTCP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation, bool reportProgress)
49+
internal static void CheckTCP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation, bool reportProgress)
5450
{
55-
List<LvCheck> lv = new List<LvCheck>();
5651
for (int i = startPort; i <= stopPort; i++)
5752
{
5853
if (scanOperation.IsCancelled) break;
@@ -66,7 +61,6 @@ internal static List<LvCheck> CheckTCP(string address, int startPort, int stopPo
6661
Description = IsTcpOpen(address, i, timeout) ? "Open" : "Closed",
6762
ScanDate = DateTime.Now.ToString(CultureInfo.CurrentCulture)
6863
};
69-
lv.Add(check);
7064

7165
if (reportProgress)
7266
{
@@ -79,8 +73,6 @@ internal static List<LvCheck> CheckTCP(string address, int startPort, int stopPo
7973
{
8074
scanOperation.ScanCompletedEvent?.Invoke();
8175
}
82-
83-
return lv;
8476
}
8577

8678
// ReSharper disable once InconsistentNaming
@@ -93,10 +85,8 @@ internal static List<LvCheck> CheckTCP(string address, int startPort, int stopPo
9385
/// <param name="timeout">The amount of time before the connection times out</param>
9486
/// <param name="scanOperation">The ScanInformation object containing information regarding this scan</param>
9587
/// <param name="reportProgress">A boolean to represent whether this method should report the current progress or not</param>
96-
/// <returns>A list of LvCheck objects containing information regarding the ports and address that were scanned</returns>
97-
internal static List<LvCheck> CheckUDP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation, bool reportProgress)
88+
internal static void CheckUDP(string address, int startPort, int stopPort, int timeout, ScanOperation scanOperation, bool reportProgress)
9889
{
99-
List<LvCheck> lv = new List<LvCheck>();
10090
for (int i = startPort; i <= stopPort; i++)
10191
{
10292
if (scanOperation.IsCancelled) break;
@@ -110,7 +100,6 @@ internal static List<LvCheck> CheckUDP(string address, int startPort, int stopPo
110100
Description = IsUdpOpen(address, i, timeout) ? "Open" : "Closed",
111101
ScanDate = DateTime.Now.ToString(CultureInfo.CurrentCulture)
112102
};
113-
lv.Add(check);
114103

115104
if (reportProgress)
116105
{
@@ -123,7 +112,6 @@ internal static List<LvCheck> CheckUDP(string address, int startPort, int stopPo
123112
{
124113
scanOperation.ScanCompletedEvent?.Invoke();
125114
}
126-
return lv;
127115
}
128116

129117

@@ -174,7 +162,7 @@ private static bool IsUdpOpen(string address, int port, int timeout)
174162
byte[] sendBytes = new byte[4];
175163
new Random().NextBytes(sendBytes);
176164
udpClient.Send(sendBytes, sendBytes.Length);
177-
165+
178166
IPEndPoint remoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
179167

180168
byte[] result = udpClient.Receive(ref remoteIpEndPoint);

Advanced PortChecker/Classes/Utils/GridViewSorter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private static void ColumnHeader_Click(object sender, RoutedEventArgs e)
116116
/// <typeparam name="T">DependencyObject</typeparam>
117117
/// <param name="reference">A DependencyObject</param>
118118
/// <returns>The parent of a DependencyObject</returns>
119-
internal static T GetAncestor<T>(DependencyObject reference) where T : DependencyObject
119+
private static T GetAncestor<T>(DependencyObject reference) where T : DependencyObject
120120
{
121121
DependencyObject parent = VisualTreeHelper.GetParent(reference);
122122
while (!(parent is T))
@@ -131,7 +131,7 @@ internal static T GetAncestor<T>(DependencyObject reference) where T : Dependenc
131131
/// </summary>
132132
/// <param name="view">The ICollectionView</param>
133133
/// <param name="propertyName">The name of the property</param>
134-
internal static void ApplySort(ICollectionView view, string propertyName)
134+
private static void ApplySort(ICollectionView view, string propertyName)
135135
{
136136
ListSortDirection direction = ListSortDirection.Ascending;
137137
if (view.SortDescriptions.Count > 0)

Advanced PortChecker/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("CodeDead")]
1212
[assembly: AssemblyProduct("Advanced PortChecker")]
13-
[assembly: AssemblyCopyright("Copyright © CodeDead 2018")]
13+
[assembly: AssemblyCopyright("Copyright © 2019 CodeDead")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -49,5 +49,5 @@
4949
// You can specify all the values or you can default the Build and Revision Numbers
5050
// by using the '*' as shown below:
5151
// [assembly: AssemblyVersion("1.0.*")]
52-
[assembly: AssemblyVersion("1.4.0.0")]
53-
[assembly: AssemblyFileVersion("1.4.0.0")]
52+
[assembly: AssemblyVersion("1.5.0.0")]
53+
[assembly: AssemblyFileVersion("1.5.0.0")]

Advanced PortChecker/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Advanced PortChecker/Properties/Settings.Designer.cs

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Advanced PortChecker/Windows/AboutWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
Images: small-n-flat by paomedia
3131
Theme by: Syncfusion
32-
Version: 1.4.0.0
32+
Version: 1.5.0.0
3333

34-
Copyright © CodeDead 2018</TextBlock.Text>
34+
Copyright © 2019 CodeDead</TextBlock.Text>
3535
</TextBlock>
3636
</Grid>
3737
<Grid Grid.Row="1">

0 commit comments

Comments
 (0)