Skip to content

Commit 28616fb

Browse files
authored
Merge pull request #1914 from Hosch250/Issue1776
Put Open Project Properties in Code Explorer node context menu
2 parents f67c6c7 + 30e2986 commit 28616fb

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
4242
_addUserFormCommand = commands.OfType<CodeExplorer_AddUserFormCommand>().FirstOrDefault();
4343

4444
_openDesignerCommand = commands.OfType<CodeExplorer_OpenDesignerCommand>().FirstOrDefault();
45+
_openProjectPropertiesCommand = commands.OfType<CodeExplorer_OpenProjectPropertiesCommand>().FirstOrDefault();
4546
_renameCommand = commands.OfType<CodeExplorer_RenameCommand>().FirstOrDefault();
4647
_indenterCommand = commands.OfType<CodeExplorer_IndentCommand>().FirstOrDefault();
4748

@@ -442,6 +443,9 @@ private void SetErrorState(CodeExplorerItemViewModel itemNode, VBComponent compo
442443
private readonly ICommand _openDesignerCommand;
443444
public ICommand OpenDesignerCommand { get { return _openDesignerCommand; } }
444445

446+
private readonly ICommand _openProjectPropertiesCommand;
447+
public ICommand OpenProjectPropertiesCommand { get { return _openProjectPropertiesCommand; } }
448+
445449
private readonly ICommand _renameCommand;
446450
public ICommand RenameCommand { get { return _renameCommand; } }
447451

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@
407407
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_CommitCommand.cs" />
408408
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_AddUserFormCommand.cs" />
409409
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_CopyResultsCommand.cs" />
410+
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_OpenProjectPropertiesCommand.cs" />
410411
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_RefreshComponentCommand.cs" />
411412
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_RenameCommand.cs" />
412413
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_FindAllReferencesCommand.cs" />

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,9 @@
373373
Command="{Binding RenameCommand}"
374374
CommandParameter="{Binding SelectedItem}" />
375375
<Separator />
376+
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_OpenProjectProperties}"
377+
Command="{Binding OpenProjectPropertiesCommand}" />
378+
<Separator />
376379
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Add}">
377380
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_AddTestModuleText}"
378381
Command="{Binding AddTestModuleCommand}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Microsoft.Vbe.Interop;
2+
using Rubberduck.UI.Command;
3+
4+
namespace Rubberduck.UI.CodeExplorer.Commands
5+
{
6+
public class CodeExplorer_OpenProjectPropertiesCommand : CommandBase
7+
{
8+
private readonly VBE _vbe;
9+
10+
public CodeExplorer_OpenProjectPropertiesCommand(VBE vbe)
11+
{
12+
_vbe = vbe;
13+
}
14+
15+
public override void Execute(object parameter)
16+
{
17+
const int openProjectPropertiesId = 2578;
18+
19+
_vbe.CommandBars.FindControl(Id: openProjectPropertiesId).Execute();
20+
}
21+
}
22+
}

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
@@ -1656,4 +1656,7 @@ All our stargazers, likers &amp; followers, for the warm fuzzies
16561656
<data name="ParserState_ResolvingReferences" xml:space="preserve">
16571657
<value>Resolving references...</value>
16581658
</data>
1659+
<data name="CodeExplorer_OpenProjectProperties" xml:space="preserve">
1660+
<value>Open project properties</value>
1661+
</data>
16591662
</root>

0 commit comments

Comments
 (0)