Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Fix in Module/Project when parser state is not Ready #2117

Merged
merged 1 commit into from
Jul 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions RetailCoder.VBE/UI/Inspections/InspectionResultsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using Microsoft.Vbe.Interop;
using NLog;
using Rubberduck.Common;
Expand Down Expand Up @@ -45,8 +44,8 @@ public sealed class InspectionResultsViewModel : ViewModelBase, INavigateSelecti
_refreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), async param => await Task.Run(() => ExecuteRefreshCommandAsync()), CanExecuteRefreshCommand);
_disableInspectionCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteDisableInspectionCommand);
_quickFixCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixCommand, CanExecuteQuickFixCommand);
_quickFixInModuleCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInModuleCommand);
_quickFixInProjectCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInProjectCommand);
_quickFixInModuleCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInModuleCommand, _ => _state.Status == ParserState.Ready);
_quickFixInProjectCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInProjectCommand, _ => _state.Status == ParserState.Ready);
_copyResultsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCopyResultsCommand, CanExecuteCopyResultsCommand);
_openSettingsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), OpenSettings);

Expand Down Expand Up @@ -224,7 +223,15 @@ private set
}

private bool _canQuickFix;
public bool CanQuickFix { get { return _canQuickFix; } set { _canQuickFix = value; OnPropertyChanged(); } }
public bool CanQuickFix
{
get { return _canQuickFix; }
set
{
_canQuickFix = value;
OnPropertyChanged();
}
}

private bool _isBusy;
public bool IsBusy { get { return _isBusy; } set { _isBusy = value; OnPropertyChanged(); } }
Expand Down Expand Up @@ -335,7 +342,7 @@ private void ExecuteQuickFixCommand(object parameter)
private bool CanExecuteQuickFixCommand(object parameter)
{
var quickFix = parameter as CodeInspectionQuickFix;
return !IsBusy && quickFix != null;
return !IsBusy && quickFix != null && _state.Status == ParserState.Ready;
}

private bool _canExecuteQuickFixInModule;
Expand Down