@@ -354,11 +354,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e)
354354 }
355355 if ( hotSpot . Type == HotSpotType . Edit )
356356 {
357- editBox . BackColor = Program . Settings . SelectedColor ;
358- editBox . HotSpot = hotSpot ;
359- editBox . Visible = true ;
360-
361- editBox . ReadOnly = hotSpot . Id == HotSpot . ReadOnlyId ;
357+ ShowNodeNameEditBox ( hotSpot ) ;
362358
363359 break ;
364360 }
@@ -381,20 +377,29 @@ protected override void OnMouseDoubleClick(MouseEventArgs e)
381377 base . OnMouseDoubleClick ( e ) ;
382378 }
383379
384- public void ShowEditBoxForName ( SelectedNodeInfo selection )
380+ public void ShowNodeNameEditBox ( BaseNode node )
385381 {
386- var hotSpot = hotSpots . FirstOrDefault ( spot => spot . Address == selection . Address &&
387- spot . Type == HotSpotType . Edit &&
388- spot . Text == selection . Node . Name ) ;
382+ if ( node == null || node is BaseHexNode )
383+ {
384+ return ;
385+ }
386+
387+ var hotSpot = hotSpots
388+ . FirstOrDefault ( s => s . Node == node && s . Type == HotSpotType . Edit && s . Id == HotSpot . NameId ) ;
389389 if ( hotSpot != null )
390390 {
391- editBox . BackColor = Program . Settings . SelectedColor ;
392- editBox . HotSpot = hotSpot ;
393- editBox . Visible = true ;
394- editBox . ReadOnly = false ;
391+ ShowNodeNameEditBox ( hotSpot ) ;
395392 }
396393 }
397394
395+ private void ShowNodeNameEditBox ( HotSpot hotSpot )
396+ {
397+ editBox . BackColor = Program . Settings . SelectedColor ;
398+ editBox . HotSpot = hotSpot ;
399+ editBox . Visible = true ;
400+ editBox . ReadOnly = hotSpot . Id == HotSpot . ReadOnlyId ;
401+ }
402+
398403 private Point toolTipPosition ;
399404 protected override void OnMouseHover ( EventArgs e )
400405 {
0 commit comments