Skip to content

Commit 5e91e82

Browse files
authored
Remove data annotations from several enums (#364)
1 parent 7dec3b7 commit 5e91e82

9 files changed

+121
-39
lines changed

nanoFramework.Tools.DebugLibrary.Net/nanoFramework.Tools.DebugLibrary.Net.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,13 @@
6666
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
6767
<PrivateAssets>all</PrivateAssets>
6868
</PackageReference>
69-
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="6.0.0" />
7069
<PackageReference Include="Microsoft.SourceLink.GitHub">
7170
<Version>1.1.1</Version>
7271
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7372
<PrivateAssets>all</PrivateAssets>
7473
</PackageReference>
7574
<PackageReference Include="Nerdbank.GitVersioning">
76-
<Version>3.5.119</Version>
75+
<Version>3.6.132</Version>
7776
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
7877
<PrivateAssets>all</PrivateAssets>
7978
</PackageReference>

nanoFramework.Tools.DebugLibrary.Shared/DeviceConfiguration/Wireless80211ConfigurationPropertiesBase.cs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,50 @@
44
//
55

66
using PropertyChanged;
7-
using System.ComponentModel.DataAnnotations;
87

98
namespace nanoFramework.Tools.Debugger
109
{
10+
/// <summary>
11+
/// Base class for wireless 802.11 configuration properties.
12+
/// </summary>
1113
[AddINotifyPropertyChangedInterface]
1214
public class Wireless80211ConfigurationPropertiesBase
1315
{
16+
/// <summary>
17+
/// Id of the configuration.
18+
/// </summary>
1419
public uint Id { get; set; }
20+
21+
/// <summary>
22+
/// Authentication type for the network.
23+
/// </summary>
1524
public AuthenticationType Authentication { get; set; }
25+
26+
/// <summary>
27+
/// Encryption type for the network.
28+
/// </summary>
1629
public EncryptionType Encryption { get; set; }
30+
31+
/// <summary>
32+
/// Radio type for the network.
33+
/// </summary>
1734
public RadioType Radio { get; set; }
18-
[MaxLength(32, ErrorMessage = "Maximum allowed length for SSID is 32.")]
35+
36+
/// <summary>
37+
/// SSID of the network.
38+
/// </summary>
39+
/// <remarks>Maximum allowed length for network password is 32.</remarks>
1940
public string Ssid { get; set; }
20-
[MaxLength(64, ErrorMessage = "Maximum allowed length for network password is 64.")]
41+
42+
/// <summary>
43+
/// Password for the network.
44+
/// </summary>
45+
/// <remarks>Maximum allowed length for network password is 64</remarks>
2146
public string Password { get; set; }
47+
48+
/// <summary>
49+
/// Configuration options for the network.
50+
/// </summary>
2251
public Wireless80211_ConfigurationOptions Options { get; set; }
2352
}
2453
}

nanoFramework.Tools.DebugLibrary.Shared/DeviceConfiguration/WirelessAPConfigurationPropertiesBase.cs

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,60 @@
44
//
55

66
using PropertyChanged;
7-
using System.ComponentModel.DataAnnotations;
87

98
namespace nanoFramework.Tools.Debugger
109
{
10+
/// <summary>
11+
/// Base class for wireless Access Poing configuration properties.
12+
/// </summary>
1113
[AddINotifyPropertyChangedInterface]
1214
public class WirelessAPConfigurationPropertiesBase
1315
{
16+
/// <summary>
17+
/// Id of the configuration.
18+
/// </summary>
1419
public uint Id { get; set; }
20+
21+
/// <summary>
22+
/// Authentication type for the network.
23+
/// </summary>
1524
public AuthenticationType Authentication { get; set; }
25+
26+
/// <summary>
27+
/// Encryption type for the network.
28+
/// </summary>
1629
public EncryptionType Encryption { get; set; }
30+
31+
/// <summary>
32+
/// Radio type for the network.
33+
/// </summary>
1734
public RadioType Radio { get; set; }
18-
[MaxLength(32, ErrorMessage = "Maximum allowed length for SSID is 32.")]
35+
36+
/// <summary>
37+
/// SSID of the network.
38+
/// </summary>
39+
/// <remarks>Maximum allowed length for network password is 32.</remarks>
1940
public string Ssid { get; set; }
20-
[MaxLength(64, ErrorMessage = "Maximum allowed length for network password is 64.")]
41+
42+
/// <summary>
43+
/// Password for the network.
44+
/// </summary>
45+
/// <remarks>Maximum allowed length for network password is 64</remarks>
2146
public string Password { get; set; }
47+
48+
/// <summary>
49+
/// Configuration options for the network.
50+
/// </summary>
2251
public WirelessAP_ConfigurationOptions Options { get; set; }
52+
53+
/// <summary>
54+
/// Channel for the network.
55+
/// </summary>
2356
public byte Channel { get; set; }
57+
58+
/// <summary>
59+
/// Maximum number of connections allowed.
60+
/// </summary>
2461
public byte MaxConnections { get; set; }
2562
}
2663
}

nanoFramework.Tools.DebugLibrary.Shared/NetworkInformation/AuthenticationType.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@
44
// See LICENSE file in the project root for full license information.
55
//
66

7-
using System.ComponentModel.DataAnnotations;
7+
using System.ComponentModel;
88

99
namespace nanoFramework.Tools.Debugger
1010
{
1111
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
1212
// !!! KEEP IN SYNC WITH System.Net.NetworkInformation.AuthenticationType (in nanoFramework.System.Net) !!! //
1313
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
1414

15+
/// <summary>
16+
/// Specifies the authentication type used for joining a Wi-Fi network.
17+
/// </summary>
1518
public enum AuthenticationType : byte
1619
{
1720
/// <summary>
1821
/// No protocol.
1922
/// </summary>
2023
None = 0,
21-
24+
2225
/// <summary>
2326
/// Extensible Authentication Protocol.
2427
/// </summary>
2528
EAP,
26-
29+
2730
/// <summary>
2831
/// Protected Extensible Authentication Protocol.
2932
/// </summary>
@@ -37,31 +40,31 @@ public enum AuthenticationType : byte
3740
/// <summary>
3841
/// Open System authentication, for use with WEP encryption type.
3942
/// </summary>
40-
[Display(Description = "WEP Open")]
43+
[Description("WEP Open")]
4144
Open,
4245

4346
/// <summary>
4447
/// Shared Key authentication, for use with WEP encryption type.
4548
/// </summary>
46-
[Display(Description = "WEP Shared")]
49+
[Description("WEP Shared")]
4750
Shared,
4851

4952
/// <summary>
5053
/// Wired Equivalent Privacy protocol.
5154
/// </summary>
52-
[Display(Description = "WEP")]
55+
[Description("WEP")]
5356
WEP,
5457

5558
/// <summary>
5659
/// Wi-Fi Protected Access protocol.
5760
/// </summary>
58-
[Display(Description = "WPA")]
61+
[Description("WPA")]
5962
WPA,
6063

6164
/// <summary>
6265
/// Wi-Fi Protected Access 2 protocol.
6366
/// </summary>
64-
[Display(Description = "WPA2")]
67+
[Description("WPA2")]
6568
WPA2,
6669
}
6770
}

nanoFramework.Tools.DebugLibrary.Shared/NetworkInformation/EncryptionType.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,59 @@
44
// See LICENSE file in the project root for full license information.
55
//
66

7-
using System.ComponentModel.DataAnnotations;
7+
using System.ComponentModel;
88

99
namespace nanoFramework.Tools.Debugger
1010
{
1111
//////////////////////////////////////////////////////////////////////////////////////////////////////////
1212
// !!! KEEP IN SYNC WITH System.Net.NetworkInformation.EncryptionType (in nanoFramework.System.Net) !!! //
1313
//////////////////////////////////////////////////////////////////////////////////////////////////////////
14+
15+
/// <summary>
16+
/// Encryption type for the Wireless network interface.
17+
/// </summary>
1418
public enum EncryptionType : byte
1519
{
1620
/// <summary>
1721
/// No encryption.
1822
/// </summary>
19-
[Display(Description = "")]
23+
[Description("")]
2024
None = 0,
2125

2226
/// <summary>
2327
/// Wired Equivalent Privacy encryption.
2428
/// </summary>
25-
[Display(Description = "WEP")]
29+
[Description("WEP")]
2630
WEP,
2731

2832
/// <summary>
2933
/// Wireless Protected Access encryption.
3034
/// </summary>
31-
[Display(Description = "WPA")]
35+
[Description("WPA")]
3236
WPA,
3337

3438
/// <summary>
3539
/// Wireless Protected Access 2 encryption.
3640
/// </summary>
37-
[Display(Description = "WPA2")]
41+
[Description("WPA2")]
3842
WPA2,
3943

4044
/// <summary>
4145
/// Wireless Protected Access Pre-Shared Key encryption.
4246
/// </summary>
43-
[Display(Description = "WPA Pre-Shared Key")]
47+
[Description("WPA Pre-Shared Key")]
4448
WPA_PSK,
4549

4650
/// <summary>
4751
/// Wireless Protected Access 2 Pre-Shared Key encryption.
4852
/// </summary>
49-
[Display(Description = "WPA2 Pre-Shared Key")]
53+
[Description("WPA2 Pre-Shared Key")]
5054
WPA2_PSK2,
5155

5256
/// <summary>
5357
/// Certificate encryption.
5458
/// </summary>
55-
[Display(Description = "Certificate")]
59+
[Description("Certificate")]
5660
Certificate,
5761
}
5862
}

nanoFramework.Tools.DebugLibrary.Shared/NetworkInformation/NetworkInterfaceType.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,34 @@
44
// See LICENSE file in the project root for full license information.
55
//
66

7-
using System.ComponentModel.DataAnnotations;
7+
using System.ComponentModel;
88

99
namespace nanoFramework.Tools.Debugger
1010
{
11-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
11+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1212
// !!! KEEP IN SYNC WITH System.Net.NetworkInformation.NetworkInterfaceType (in nanoFramework.System.Net) !!! //
13-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
13+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14+
/// <summary>
15+
/// Network interface type.
16+
/// </summary>
1417
public enum NetworkInterfaceType : byte
1518
{
1619
/// <summary>
1720
/// The network interface type is unknown or not specified.
1821
/// </summary>
22+
[Description("")]
1923
Unknown = 1,
2024

2125
/// <summary>
2226
/// The network interface uses an Ethernet connection. Ethernet is defined in IEEE standard 802.3.
2327
/// </summary>
24-
[Display(Description = "Ethernet")]
28+
[Description("Ethernet")]
2529
Ethernet = 6,
2630

2731
/// <summary>
2832
/// The network interface uses a wireless LAN connection (IEEE 802.11 standard).
2933
/// </summary>
30-
[Display(Description = "Wi-Fi (802.11)")]
34+
[Description("Wi-Fi (802.11)")]
3135
Wireless80211 = 71,
3236
}
3337
}

nanoFramework.Tools.DebugLibrary.Shared/NetworkInformation/RadioType.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,41 @@
44
// See LICENSE file in the project root for full license information.
55
//
66

7-
using System.ComponentModel.DataAnnotations;
7+
using System.ComponentModel;
88

99
namespace nanoFramework.Tools.Debugger
1010
{
1111
/////////////////////////////////////////////////////////////////////////////////////////////////////
1212
// !!! KEEP IN SYNC WITH System.Net.NetworkInformation.RadioType (in nanoFramework.System.Net) !!! //
1313
/////////////////////////////////////////////////////////////////////////////////////////////////////
14+
15+
/// <summary>
16+
/// Radio type for the Wireless network interface.
17+
/// </summary>
1418
public enum RadioType : byte
1519
{
1620
/// <summary>
1721
/// 802.11a-compatible radio.
1822
/// </summary>
19-
[Display(Description = "802.11a")]
23+
[Description("802.11a")]
2024
_802_11a = 1,
2125

2226
/// <summary>
2327
/// 802.11b-compatible radio.
2428
/// </summary>
25-
[Display(Description = "802.11b")]
29+
[Description("802.11b")]
2630
_802_11b = 2,
2731

2832
/// <summary>
2933
/// 802.11g-compatible radio.
3034
/// </summary>
31-
[Display(Description = "802.11g")]
35+
[Description("802.11g")]
3236
_802_11g = 4,
3337

3438
/// <summary>
3539
/// 802.11n-compatible radio.
3640
/// </summary>
37-
[Display(Description = "802.11n")]
41+
[Description("802.11n")]
3842
_802_11n = 8,
3943
}
4044
}

nanoFramework.Tools.DebugLibrary.Shared/NetworkInformation/Wireless80211_ConfigurationOptions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
//
55

66
using System;
7-
using System.ComponentModel.DataAnnotations;
7+
using System.ComponentModel;
88

99
namespace nanoFramework.Tools.Debugger
1010
{
1111
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1212
// !!! KEEP IN SYNC WITH System.Net.NetworkInformation.Wireless80211Configuration.ConfigurationOptions (in nanoFramework.System.Net) !!! //
1313
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14+
1415
/// <summary>
1516
/// Configuration flags used for Wireless configuration.
1617
/// </summary>
@@ -37,7 +38,7 @@ public enum Wireless80211_ConfigurationOptions : byte
3738
/// Will auto connect when AP is available or after being disconnected.
3839
/// This option forces enabling the Wireless station.
3940
/// </summary>
40-
[Display(Description = "Auto connect")]
41+
[Description("Auto connect")]
4142
AutoConnect = 0x04 | Enable,
4243

4344
/// <summary>

0 commit comments

Comments
 (0)