Skip to content

Commit 5fd01c0

Browse files
committed
Added RefreshCommand and associated paraphernalia
1 parent dfaa590 commit 5fd01c0

File tree

7 files changed

+56
-0
lines changed

7 files changed

+56
-0
lines changed

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ private IEnumerable<IMenuItem> GetRubberduckMenuItems()
508508
{
509509
return new[]
510510
{
511+
KernelInstance.Get<RefreshCommandMenuItem>(),
511512
KernelInstance.Get<AboutCommandMenuItem>(),
512513
KernelInstance.Get<SettingsCommandMenuItem>(),
513514
KernelInstance.Get<InspectionResultsCommandMenuItem>(),

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,11 @@
422422
<Compile Include="UI\Command\FormDesignerFindAllReferencesCommand.cs" />
423423
<Compile Include="UI\Command\IndentCurrentProjectCommand.cs" />
424424
<Compile Include="UI\Command\MenuItems\CommandBars\ContextDescriptionLabelMenuItem.cs" />
425+
<Compile Include="UI\Command\MenuItems\RefreshCommandMenuItem.cs" />
425426
<Compile Include="UI\Command\MenuItems\FormDesignerFindAllReferencesCommandMenuItem.cs" />
426427
<Compile Include="UI\Command\MenuItems\IndentCurrentProjectCommandMenuItem.cs" />
427428
<Compile Include="UI\Command\MenuItems\ExportAllCommandMenuItem.cs" />
429+
<Compile Include="UI\Command\RefreshCommand .cs" />
428430
<Compile Include="UI\Controls\EmptyUIRefresh.xaml.cs">
429431
<DependentUpon>EmptyUIRefresh.xaml</DependentUpon>
430432
</Compile>

RetailCoder.VBE/UI/Command/MenuItems/ParentMenus/RubberduckParentMenu.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public RubberduckParentMenu(IEnumerable<IMenuItem> items, int beforeIndex)
1212

1313
public enum RubberduckMenuItemDisplayOrder
1414
{
15+
Refresh,
1516
UnitTesting,
1617
Refactorings,
1718
Navigate,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Rubberduck.UI.Command.MenuItems.ParentMenus;
2+
3+
namespace Rubberduck.UI.Command.MenuItems
4+
{
5+
public class RefreshCommandMenuItem : CommandMenuItemBase
6+
{
7+
public RefreshCommandMenuItem(CommandBase command) : base(command)
8+
{
9+
}
10+
public override string Key => "RubberduckMenu_Refresh";
11+
public override int DisplayOrder => (int)RubberduckMenuItemDisplayOrder.Refresh;
12+
}
13+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Runtime.InteropServices;
2+
using NLog;
3+
4+
namespace Rubberduck.UI.Command
5+
{
6+
[ComVisible(false)]
7+
public class RefreshCommand : CommandBase
8+
{
9+
private readonly ReparseCommand _command;
10+
11+
public RefreshCommand(ReparseCommand command)
12+
: base(LogManager.GetCurrentClassLogger())
13+
{
14+
_command = command;
15+
}
16+
17+
protected override bool EvaluateCanExecute(object parameter)
18+
{
19+
return _command?.CanExecute(parameter) ?? false;
20+
}
21+
22+
protected override void OnExecute(object parameter)
23+
{
24+
_command?.Execute(parameter);
25+
}
26+
}
27+
}

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,4 +2104,7 @@ the projects in the VBE.</value>
21042104
<value>Test module with stubs</value>
21052105
<comment>TC</comment>
21062106
</data>
2107+
<data name="RubberduckMenu_Refresh" xml:space="preserve">
2108+
<value>Refresh</value>
2109+
</data>
21072110
</root>

0 commit comments

Comments
 (0)