File tree Expand file tree Collapse file tree
NETworkManager.Utilities.WPF Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change 1- using System . Collections . Generic ;
1+ using System ;
2+ using System . Collections . Generic ;
23
34namespace 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
You can’t perform that action at this time.
0 commit comments