Skip to content

Commit ab50990

Browse files
committed
Really tiny update for RefactorItem class
Moved to a separate file, and changed Description property value.
1 parent 54bdb08 commit ab50990

File tree

3 files changed

+56
-46
lines changed

3 files changed

+56
-46
lines changed

External/Plugins/CodeRefactor/CodeRefactor.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<Compile Include="Provider\MovingHelper.cs" />
114114
<Compile Include="Provider\RefactoringHelper.cs" />
115115
<Compile Include="Provider\UserInterfaceManager.cs" />
116+
<Compile Include="RefactorItem.cs" />
116117
<Compile Include="Settings.cs" />
117118
</ItemGroup>
118119
<ItemGroup>

External/Plugins/CodeRefactor/PluginMain.cs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel;
4-
using System.Drawing;
54
using System.IO;
65
using System.Text.RegularExpressions;
76
using System.Windows.Forms;
@@ -690,50 +689,5 @@ void OnAddRefactorOptions(List<ICompletionListItem> list)
690689
}
691690

692691
#endregion
693-
694-
}
695-
696-
class RefactorItem : ICompletionListItem
697-
{
698-
ToolStripItem item;
699-
string label;
700-
Bitmap icon;
701-
702-
public static void AddItemToList(ToolStripMenuItem item, List<ICompletionListItem> list)
703-
{
704-
if (item.Enabled)
705-
list.Add(new RefactorItem(item));
706-
}
707-
708-
public RefactorItem(ToolStripItem item)
709-
{
710-
this.item = item;
711-
label = Regex.Replace(item.Text, "[&.]", string.Empty);
712-
icon = new Bitmap(item.Image ?? PluginBase.MainForm.FindImage("452")); //452, 473
713-
}
714-
715-
public string Description
716-
{
717-
get { return label; /*TextHelper.GetString("ASCompletion.Info.GeneratorTemplate");*/ }
718-
}
719-
720-
public Bitmap Icon
721-
{
722-
get { return icon; }
723-
}
724-
725-
public string Label
726-
{
727-
get { return label; }
728-
}
729-
730-
public string Value
731-
{
732-
get
733-
{
734-
item.PerformClick();
735-
return null;
736-
}
737-
}
738692
}
739693
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Collections.Generic;
2+
using System.Drawing;
3+
using System.Text.RegularExpressions;
4+
using System.Windows.Forms;
5+
using PluginCore;
6+
using PluginCore.Localization;
7+
8+
namespace CodeRefactor
9+
{
10+
class RefactorItem : ICompletionListItem
11+
{
12+
Bitmap icon;
13+
string description;
14+
string label;
15+
ToolStripItem item;
16+
17+
public static void AddItemToList(ToolStripItem item, List<ICompletionListItem> list)
18+
{
19+
if (item.Enabled)
20+
list.Add(new RefactorItem(item));
21+
}
22+
23+
public RefactorItem(ToolStripItem item)
24+
{
25+
this.item = item;
26+
label = Regex.Replace(item.Text, "[&.]", string.Empty);
27+
description = TextHelper.GetString("Label.Refactor").Replace("&", string.Empty);
28+
icon = new Bitmap(item.Image ?? PluginBase.MainForm.FindImage("452")); //452 or 473
29+
}
30+
31+
public string Description
32+
{
33+
get { return description; }
34+
}
35+
36+
public Bitmap Icon
37+
{
38+
get { return icon; }
39+
}
40+
41+
public string Label
42+
{
43+
get { return label; }
44+
}
45+
46+
public string Value
47+
{
48+
get
49+
{
50+
item.PerformClick();
51+
return null;
52+
}
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)