Skip to content

Commit 65d15cd

Browse files
committed
Merge branch 'main' into feature/firewall
2 parents 9b5cb11 + 70f2bbb commit 65d15cd

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

Source/NETworkManager.Profiles/ProfileViewInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class ProfileViewInfo
1616
/// <summary>
1717
/// Initializes a new instance of the ProfileViewInfo class with the specified profile name, icon, and group.
1818
/// </summary>
19-
/// <param name="name">The name of the profile to associate with this view. Cannot be null.</param>
19+
/// <param name="name">The name of the profile to associate with this view. Must be a valid ProfileName instance.</param>
2020
/// <param name="icon">The icon representing the profile. Cannot be null.</param>
21-
/// <param name="group">The group to which the profile belongs. Cannot be null.</param>
21+
/// <param name="group">The group to which the profile belongs. Must be a valid ProfileGroup instance.</param>
2222
public ProfileViewInfo(ProfileName name, Canvas icon, ProfileGroup group)
2323
{
2424
Name = name;

Source/NETworkManager.Utilities.WPF/BindingProxy.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ public object Data
3030
set => SetValue(DataProperty, value);
3131
}
3232

33-
/// Creates a new instance of the BindingProxy class.
33+
/// <summary>
34+
/// Creates a new instance of the <see cref="BindingProxy"/> class.
35+
/// </summary>
3436
/// <returns>
35-
/// A new instance of the BindingProxy class.
37+
/// A new instance of the <see cref="BindingProxy"/> class.
3638
/// </returns>
3739
protected override Freezable CreateInstanceCore()
3840
{

Source/NETworkManager.Utilities/ListHelper.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23

34
namespace NETworkManager.Utilities;
45
/// <summary>
@@ -17,18 +18,18 @@ public static class ListHelper
1718
/// <returns>Modified list with the new entry added and oldest entries removed if necessary.</returns>
1819
public static List<T> Modify<T>(List<T> list, T entry, int length)
1920
{
20-
var removedEntry = false;
21-
2221
int index;
23-
22+
2423
while ((index = list.IndexOf(entry)) != -1)
2524
{
2625
list.RemoveAt(index);
27-
removedEntry = true;
2826
}
2927

30-
if (!removedEntry && list.Count == length)
31-
list.RemoveAt(length - 1);
28+
if (length <= 0)
29+
throw new ArgumentOutOfRangeException(nameof(length), "Length must be greater than zero.");
30+
31+
while (list.Count >= length)
32+
list.RemoveAt(list.Count - 1);
3233

3334
list.Insert(0, entry);
3435

0 commit comments

Comments
 (0)