-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/next' into CodeExplorer_Issue4…
…541_resx_cleanup
- Loading branch information
Showing
46 changed files
with
1,107 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
Rubberduck.Core/UI/Command/ComCommands/ProjectExplorerIgnoreProjectCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Rubberduck.Parsing.Settings; | ||
using Rubberduck.SettingsProvider; | ||
using Rubberduck.VBEditor.Events; | ||
using Rubberduck.VBEditor.Extensions; | ||
using Rubberduck.VBEditor.SafeComWrappers.Abstract; | ||
|
||
namespace Rubberduck.UI.Command.ComCommands | ||
{ | ||
public class ProjectExplorerIgnoreProjectCommand : ComCommandBase | ||
{ | ||
private readonly IVBE _vbe; | ||
private readonly IConfigurationService<IgnoredProjectsSettings> _configService; | ||
|
||
public ProjectExplorerIgnoreProjectCommand(IVbeEvents vbeEvents, IVBE vbe, IConfigurationService<IgnoredProjectsSettings> configService) | ||
: base(vbeEvents) | ||
{ | ||
_vbe = vbe; | ||
_configService = configService; | ||
AddToCanExecuteEvaluation(SpecialEvaluateCanExecute, true); | ||
} | ||
|
||
private bool SpecialEvaluateCanExecute(object parameter) | ||
{ | ||
using (var activeProject = _vbe.ActiveVBProject) | ||
{ | ||
if (activeProject == null | ||
|| !activeProject.TryGetFullPath(out var fullPath)) | ||
{ | ||
return false; | ||
} | ||
|
||
var ignoredProjectPaths = _configService.Read().IgnoredProjectPaths; | ||
return !ignoredProjectPaths.Contains(fullPath); | ||
} | ||
} | ||
|
||
protected override void OnExecute(object parameter) | ||
{ | ||
using (var activeProject = _vbe.ActiveVBProject) | ||
{ | ||
if (activeProject == null | ||
|| !activeProject.TryGetFullPath(out var fullPath)) | ||
{ | ||
return; | ||
} | ||
|
||
var ignoredProjectsSetting = _configService.Read(); | ||
if (!ignoredProjectsSetting.IgnoredProjectPaths.Contains(fullPath)) | ||
{ | ||
ignoredProjectsSetting.IgnoredProjectPaths.Add(fullPath); | ||
_configService.Save(ignoredProjectsSetting); | ||
} | ||
} | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
Rubberduck.Core/UI/Command/ComCommands/ProjectExplorerUnignoreProjectCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Rubberduck.Parsing.Settings; | ||
using Rubberduck.SettingsProvider; | ||
using Rubberduck.VBEditor.Events; | ||
using Rubberduck.VBEditor.Extensions; | ||
using Rubberduck.VBEditor.SafeComWrappers.Abstract; | ||
|
||
namespace Rubberduck.UI.Command.ComCommands | ||
{ | ||
public class ProjectExplorerUnignoreProjectCommand : ComCommandBase | ||
{ | ||
private readonly IVBE _vbe; | ||
private readonly IConfigurationService<IgnoredProjectsSettings> _configService; | ||
|
||
public ProjectExplorerUnignoreProjectCommand(IVbeEvents vbeEvents, IVBE vbe, IConfigurationService<IgnoredProjectsSettings> configService) | ||
: base(vbeEvents) | ||
{ | ||
_vbe = vbe; | ||
_configService = configService; | ||
AddToCanExecuteEvaluation(SpecialEvaluateCanExecute, true); | ||
} | ||
|
||
private bool SpecialEvaluateCanExecute(object parameter) | ||
{ | ||
using (var activeProject = _vbe.ActiveVBProject) | ||
{ | ||
if (activeProject == null | ||
|| !activeProject.TryGetFullPath(out var fullPath)) | ||
{ | ||
return false; | ||
} | ||
|
||
var ignoredProjectPaths = _configService.Read().IgnoredProjectPaths; | ||
return ignoredProjectPaths.Contains(fullPath); | ||
} | ||
} | ||
|
||
protected override void OnExecute(object parameter) | ||
{ | ||
using (var activeProject = _vbe.ActiveVBProject) | ||
{ | ||
if (activeProject == null | ||
|| !activeProject.TryGetFullPath(out var fullPath)) | ||
{ | ||
return; | ||
} | ||
|
||
var ignoredProjectsSetting = _configService.Read(); | ||
if (ignoredProjectsSetting.IgnoredProjectPaths.Contains(fullPath)) | ||
{ | ||
ignoredProjectsSetting.IgnoredProjectPaths.Remove(fullPath); | ||
_configService.Save(ignoredProjectsSetting); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Rubberduck.Core/UI/Command/MenuItems/ProjectExplorerIgnoreProjectCommandMenuItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Rubberduck.UI.Command.ComCommands; | ||
using Rubberduck.UI.Command.MenuItems.ParentMenus; | ||
|
||
namespace Rubberduck.UI.Command.MenuItems | ||
{ | ||
public class ProjectExplorerIgnoreProjectCommandMenuItem : CommandMenuItemBase | ||
{ | ||
public ProjectExplorerIgnoreProjectCommandMenuItem(ProjectExplorerIgnoreProjectCommand command) | ||
: base(command) | ||
{ } | ||
|
||
public override string Key => "ProjectExplorer_IgnoreProject"; | ||
public override int DisplayOrder => (int)ProjectExplorerContextMenuItemDisplayOrder.IgnoreProject; | ||
public override bool BeginGroup => true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Rubberduck.Core/UI/Command/MenuItems/ProjectExplorerUnignoreProjectCommandMenuItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Rubberduck.UI.Command.ComCommands; | ||
using Rubberduck.UI.Command.MenuItems.ParentMenus; | ||
|
||
namespace Rubberduck.UI.Command.MenuItems | ||
{ | ||
public class ProjectExplorerUnignoreProjectCommandMenuItem : CommandMenuItemBase | ||
{ | ||
public ProjectExplorerUnignoreProjectCommandMenuItem(ProjectExplorerUnignoreProjectCommand command) | ||
: base(command) | ||
{ } | ||
|
||
public override string Key => "ProjectExplorer_UnignoreProject"; | ||
public override int DisplayOrder => (int)ProjectExplorerContextMenuItemDisplayOrder.UnignoreProject; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.