@@ -24,12 +24,14 @@ public static void AddToQueue(ASResult target)
24
24
}
25
25
public static void AddToQueue ( ASResult target , bool outputResults )
26
26
{
27
- string originalName = RefactoringHelper . GetRefactorTargetName ( target ) ;
28
- string label = TextHelper . GetString ( "Label.NewName" ) ;
29
- string title = string . Format ( TextHelper . GetString ( "Title.RenameDialog" ) , originalName ) ;
30
- LineEntryDialog askName = new LineEntryDialog ( title , label , originalName ) ;
31
- if ( askName . ShowDialog ( ) == DialogResult . OK )
27
+ if ( target . IsPackage ) queue . Add ( new Rename ( target , outputResults ) ) ;
28
+ else
32
29
{
30
+ string originalName = RefactoringHelper . GetRefactorTargetName ( target ) ;
31
+ string label = TextHelper . GetString ( "Label.NewName" ) ;
32
+ string title = string . Format ( TextHelper . GetString ( "Title.RenameDialog" ) , originalName ) ;
33
+ LineEntryDialog askName = new LineEntryDialog ( title , label , originalName ) ;
34
+ if ( askName . ShowDialog ( ) != DialogResult . OK ) return ;
33
35
string newName = askName . Line . Trim ( ) ;
34
36
if ( newName . Length == 0 || newName == originalName ) return ;
35
37
queue . Add ( new Rename ( target , outputResults , newName ) ) ;
@@ -40,8 +42,8 @@ public static void AddToQueue(ASResult target, bool outputResults)
40
42
if ( list [ 0 ] . Name == "get" ) RenameMember ( target . InClass , "get_" + originalName , "get_" + newName , outputResults ) ;
41
43
if ( list [ 1 ] . Name == "set" ) RenameMember ( target . InClass , "set_" + originalName , "set_" + newName , outputResults ) ;
42
44
}
43
- if ( currentCommand == null ) ExecuteFirst ( ) ;
44
45
}
46
+ if ( currentCommand == null ) ExecuteFirst ( ) ;
45
47
}
46
48
47
49
static void RenameMember ( ClassModel inClass , string name , string newName , bool outputResults )
0 commit comments