|
8 | 8 | using System.Threading;
|
9 | 9 | using System.Threading.Tasks;
|
10 | 10 | using System.Windows;
|
11 |
| -using System.Windows.Input; |
12 | 11 | using Microsoft.Vbe.Interop;
|
13 | 12 | using NLog;
|
14 | 13 | using Rubberduck.Common;
|
@@ -45,8 +44,8 @@ public InspectionResultsViewModel(RubberduckParserState state, IInspector inspec
|
45 | 44 | _refreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), async param => await Task.Run(() => ExecuteRefreshCommandAsync()), CanExecuteRefreshCommand);
|
46 | 45 | _disableInspectionCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteDisableInspectionCommand);
|
47 | 46 | _quickFixCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixCommand, CanExecuteQuickFixCommand);
|
48 |
| - _quickFixInModuleCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInModuleCommand); |
49 |
| - _quickFixInProjectCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInProjectCommand); |
| 47 | + _quickFixInModuleCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInModuleCommand, _ => _state.Status == ParserState.Ready); |
| 48 | + _quickFixInProjectCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteQuickFixInProjectCommand, _ => _state.Status == ParserState.Ready); |
50 | 49 | _copyResultsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCopyResultsCommand, CanExecuteCopyResultsCommand);
|
51 | 50 | _openSettingsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), OpenSettings);
|
52 | 51 |
|
@@ -224,7 +223,15 @@ private set
|
224 | 223 | }
|
225 | 224 |
|
226 | 225 | private bool _canQuickFix;
|
227 |
| - public bool CanQuickFix { get { return _canQuickFix; } set { _canQuickFix = value; OnPropertyChanged(); } } |
| 226 | + public bool CanQuickFix |
| 227 | + { |
| 228 | + get { return _canQuickFix; } |
| 229 | + set |
| 230 | + { |
| 231 | + _canQuickFix = value; |
| 232 | + OnPropertyChanged(); |
| 233 | + } |
| 234 | + } |
228 | 235 |
|
229 | 236 | private bool _isBusy;
|
230 | 237 | public bool IsBusy { get { return _isBusy; } set { _isBusy = value; OnPropertyChanged(); } }
|
@@ -335,7 +342,7 @@ private void ExecuteQuickFixCommand(object parameter)
|
335 | 342 | private bool CanExecuteQuickFixCommand(object parameter)
|
336 | 343 | {
|
337 | 344 | var quickFix = parameter as CodeInspectionQuickFix;
|
338 |
| - return !IsBusy && quickFix != null; |
| 345 | + return !IsBusy && quickFix != null && _state.Status == ParserState.Ready; |
339 | 346 | }
|
340 | 347 |
|
341 | 348 | private bool _canExecuteQuickFixInModule;
|
|
0 commit comments