1
1
using System ;
2
- using System . Text ;
3
- using System . Drawing ;
4
2
using System . Windows . Forms ;
5
- using PluginCore . Localization ;
6
3
using PluginCore ;
4
+ using PluginCore . Localization ;
7
5
8
6
namespace CodeRefactor . Controls
9
7
{
10
8
public class RefactorMenu : ToolStripMenuItem
11
9
{
12
- private SurroundMenu surroundMenu ;
13
- private ToolStripMenuItem batchMenuItem ;
14
- private ToolStripMenuItem renameMenuItem ;
15
- private ToolStripMenuItem truncateMenuItem ;
16
- private ToolStripMenuItem organizeMenuItem ;
17
- private ToolStripMenuItem delegateMenuItem ;
18
- private ToolStripMenuItem generatorMenuItem ;
19
- private ToolStripMenuItem extractMethodMenuItem ;
20
- private ToolStripMenuItem extractLocalVariableMenuItem ;
21
-
22
10
public RefactorMenu ( Boolean createSurroundMenu )
23
11
{
24
12
this . Text = TextHelper . GetString ( "Label.Refactor" ) ;
25
- this . renameMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.Rename" ) ) as ToolStripMenuItem ;
26
- this . renameMenuItem . Image = PluginBase . MainForm . FindImage ( "331" ) ;
27
- this . extractMethodMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.ExtractMethod" ) , null ) as ToolStripMenuItem ;
28
- this . extractLocalVariableMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.ExtractLocalVariable" ) , null ) as ToolStripMenuItem ;
29
- this . delegateMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.DelegateMethods" ) , null ) as ToolStripMenuItem ;
13
+ this . RenameMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.Rename" ) ) as ToolStripMenuItem ;
14
+ this . RenameMenuItem . Image = PluginBase . MainForm . FindImage ( "331" ) ;
15
+ #region TODO: localize me
16
+ MoveMenuItem = DropDownItems . Add ( "Move..." ) as ToolStripMenuItem ;
17
+ //MoveMenuItem = DropDownItems.Add(TextHelper.GetString("Label.Move")) as ToolStripMenuItem;
18
+ #endregion
19
+ this . ExtractMethodMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.ExtractMethod" ) , null ) as ToolStripMenuItem ;
20
+ this . ExtractLocalVariableMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.ExtractLocalVariable" ) , null ) as ToolStripMenuItem ;
21
+ this . DelegateMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.DelegateMethods" ) , null ) as ToolStripMenuItem ;
30
22
if ( createSurroundMenu )
31
23
{
32
- this . surroundMenu = new SurroundMenu ( ) ;
33
- this . DropDownItems . Add ( this . surroundMenu ) ;
24
+ this . SurroundMenu = new SurroundMenu ( ) ;
25
+ this . DropDownItems . Add ( this . SurroundMenu ) ;
34
26
}
35
27
this . DropDownItems . Add ( new ToolStripSeparator ( ) ) ;
36
- this . generatorMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.InvokeCodeGenerator" ) , null , null , createSurroundMenu ? Keys . Control | Keys . Shift | Keys . D1 : Keys . None ) ;
37
- this . DropDownItems . Add ( this . generatorMenuItem ) ;
28
+ this . CodeGeneratorMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.InvokeCodeGenerator" ) , null , null , createSurroundMenu ? Keys . Control | Keys . Shift | Keys . D1 : Keys . None ) ;
29
+ this . DropDownItems . Add ( this . CodeGeneratorMenuItem ) ;
38
30
this . DropDownItems . Add ( new ToolStripSeparator ( ) ) ;
39
- this . organizeMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.OrganizeImports" ) , null ) as ToolStripMenuItem ;
40
- this . truncateMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.TruncateImports" ) , null ) as ToolStripMenuItem ;
31
+ this . OrganizeMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.OrganizeImports" ) , null ) as ToolStripMenuItem ;
32
+ this . TruncateMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.TruncateImports" ) , null ) as ToolStripMenuItem ;
41
33
this . DropDownItems . Add ( new ToolStripSeparator ( ) ) ;
42
- this . batchMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.BatchProcess" ) , null ) as ToolStripMenuItem ;
34
+ this . BatchMenuItem = this . DropDownItems . Add ( TextHelper . GetString ( "Label.BatchProcess" ) , null ) as ToolStripMenuItem ;
43
35
}
44
36
45
37
/// <summary>
46
38
/// Accessor to the SurroundMenu
47
39
/// </summary>
48
- public SurroundMenu SurroundMenu
49
- {
50
- get { return this . surroundMenu ; }
51
- }
40
+ public SurroundMenu SurroundMenu { get ; private set ; }
52
41
53
42
/// <summary>
54
43
/// Accessor to the BatchMenuItem
55
44
/// </summary>
56
- public ToolStripMenuItem BatchMenuItem
57
- {
58
- get { return this . batchMenuItem ; }
59
- }
45
+ public ToolStripMenuItem BatchMenuItem { get ; private set ; }
60
46
61
47
/// <summary>
62
48
/// Accessor to the RenameMenuItem
63
49
/// </summary>
64
- public ToolStripMenuItem RenameMenuItem
65
- {
66
- get { return this . renameMenuItem ; }
67
- }
50
+ public ToolStripMenuItem RenameMenuItem { get ; private set ; }
51
+
52
+ /// <summary>
53
+ /// Accessor to the MoveMenuItem
54
+ /// </summary>
55
+ public ToolStripMenuItem MoveMenuItem { get ; private set ; }
68
56
69
57
/// <summary>
70
58
/// Accessor to the TruncateMenuItem
71
59
/// </summary>
72
- public ToolStripMenuItem TruncateMenuItem
73
- {
74
- get { return this . truncateMenuItem ; }
75
- }
60
+ public ToolStripMenuItem TruncateMenuItem { get ; private set ; }
76
61
77
62
/// <summary>
78
63
/// Accessor to the OrganizeMenuItem
79
64
/// </summary>
80
- public ToolStripMenuItem OrganizeMenuItem
81
- {
82
- get { return this . organizeMenuItem ; }
83
- }
65
+ public ToolStripMenuItem OrganizeMenuItem { get ; private set ; }
84
66
85
67
/// <summary>
86
68
/// Accessor to the ExtractMethodMenuItem
87
69
/// </summary>
88
- public ToolStripMenuItem ExtractMethodMenuItem
89
- {
90
- get { return this . extractMethodMenuItem ; }
91
- }
70
+ public ToolStripMenuItem ExtractMethodMenuItem { get ; private set ; }
92
71
93
72
/// <summary>
94
73
/// Accessor to the DelegateMenuItem
95
74
/// </summary>
96
- public ToolStripMenuItem DelegateMenuItem
97
- {
98
- get { return this . delegateMenuItem ; }
99
- }
75
+ public ToolStripMenuItem DelegateMenuItem { get ; private set ; }
100
76
101
77
/// <summary>
102
78
/// Accessor to the ExtractLocalVariableMenuItem
103
79
/// </summary>
104
- public ToolStripMenuItem ExtractLocalVariableMenuItem
105
- {
106
- get { return this . extractLocalVariableMenuItem ; }
107
- }
80
+ public ToolStripMenuItem ExtractLocalVariableMenuItem { get ; private set ; }
108
81
109
82
/// <summary>
110
83
/// Accessor to the CodeGeneratorMenuItem
111
84
/// </summary>
112
- public ToolStripMenuItem CodeGeneratorMenuItem
113
- {
114
- get { return this . generatorMenuItem ; }
115
- }
116
-
85
+ public ToolStripMenuItem CodeGeneratorMenuItem { get ; private set ; }
117
86
}
118
-
119
- }
87
+ }
0 commit comments