@@ -392,7 +392,6 @@ void AssignNewShortcut(ShortcutListItem item, Keys shortcut)
392
392
if ( item . Custom == shortcut ) return ;
393
393
item . Custom = shortcut ;
394
394
item . Selected = true ;
395
- ResetConflicts ( item ) ;
396
395
this . GetConflictItems ( item ) ;
397
396
if ( item . HasConflicts )
398
397
{
@@ -446,21 +445,19 @@ void GetConflictItems(ShortcutListItem target)
446
445
var keys = target . Custom ;
447
446
if ( keys == 0 ) return ;
448
447
449
- var conflicts = new List < ShortcutListItem > { target } ;
448
+ List < ShortcutListItem > conflicts = null ;
450
449
451
450
for ( int i = 0 ; i < this . shortcutListItems . Length ; i ++ )
452
451
{
453
452
var item = this . shortcutListItems [ i ] ;
454
453
455
- if ( item == target ) continue ;
456
- if ( item . Custom == keys )
457
- {
458
- conflicts . Add ( item ) ;
459
- item . Conflicts = conflicts ;
460
- }
454
+ if ( item . Custom != keys || item == target ) continue ;
455
+ if ( conflicts == null ) conflicts = new List < ShortcutListItem > { target } ;
456
+ conflicts . Add ( item ) ;
457
+ item . Conflicts = conflicts ;
461
458
}
462
459
463
- if ( conflicts . Count > 1 ) target . Conflicts = conflicts ;
460
+ target . Conflicts = conflicts ;
464
461
}
465
462
466
463
/// <summary>
@@ -635,7 +632,6 @@ public List<ShortcutListItem> Conflicts
635
632
get { return this . conflicts ; }
636
633
set
637
634
{
638
- if ( this . conflicts == value ) return ;
639
635
this . conflicts = value ;
640
636
UpdateItemHighlightFont ( this ) ;
641
637
}
@@ -665,10 +661,10 @@ public Keys Custom
665
661
get { return this . custom ; }
666
662
set
667
663
{
668
- if ( this . custom == value ) return ;
669
664
this . custom = value ;
670
665
this . KeysString = DataConverter . KeysToString ( this . custom ) ;
671
666
this . SubItems [ 1 ] . Text = this . KeysString ;
667
+ ResetConflicts ( this ) ;
672
668
UpdateItemHighlightFont ( this ) ;
673
669
}
674
670
}
@@ -695,11 +691,13 @@ public bool IsModified
695
691
/// </summary>
696
692
public ShortcutListItem ( ShortcutItem shortcutItem )
697
693
{
698
- this . SubItems . Add ( string . Empty ) ;
699
- this . Name = this . Text = shortcutItem . Id ;
700
694
this . item = shortcutItem ;
701
695
this . conflicts = null ;
702
- this . Custom = shortcutItem . Custom ;
696
+ this . custom = this . Item . Custom ;
697
+ this . KeysString = DataConverter . KeysToString ( this . Custom ) ;
698
+ this . Name = this . Text = this . Id ;
699
+ this . SubItems . Add ( this . KeysString ) ;
700
+ UpdateItemHighlightFont ( this ) ;
703
701
}
704
702
705
703
/// <summary>
0 commit comments