Skip to content

Commit aba3402

Browse files
committed
Merge branch 'next' into next
2 parents 4c4cd63 + 05b3d97 commit aba3402

File tree

7 files changed

+10
-39
lines changed

7 files changed

+10
-39
lines changed

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
3737

3838
_clipboard = new ClipboardWriter();
3939

40-
_refreshCommand = commands.OfType<CodeExplorer_RefreshCommand>().FirstOrDefault();
40+
_refreshCommand = new DelegateCommand(param => _state.OnParseRequested(this),
41+
param => !IsBusy && _state.IsDirty());
42+
4143
_refreshComponentCommand = commands.OfType<CodeExplorer_RefreshComponentCommand>().FirstOrDefault();
4244
_navigateCommand = commands.OfType<CodeExplorer_NavigateCommand>().FirstOrDefault();
4345

@@ -210,18 +212,6 @@ public bool IsBusy
210212
{
211213
_isBusy = value;
212214
OnPropertyChanged();
213-
CanRefresh = !_isBusy;
214-
}
215-
}
216-
217-
private bool _canRefresh = true;
218-
public bool CanRefresh
219-
{
220-
get { return _canRefresh; }
221-
private set
222-
{
223-
_canRefresh = value;
224-
OnPropertyChanged();
225215
}
226216
}
227217

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@
410410
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_FindAllImplementationsCommand.cs" />
411411
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_IndentCommand.cs" />
412412
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_NavigateCommand.cs" />
413-
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_RefreshCommand.cs" />
414413
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_RemoveCommand.cs" />
415414
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_ExportCommand.cs" />
416415
<Compile Include="UI\CodeExplorer\Commands\CodeExplorer_ImportCommand.cs" />

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@
628628
<ToolBarTray Grid.Row="0" IsLocked="True">
629629
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}">
630630

631-
<Button Command="{Binding RefreshCommand}" IsEnabled="{Binding CanRefresh}">
631+
<Button Command="{Binding RefreshCommand}">
632632
<Image Height="16" Source="../../Resources/arrow-circle-double.png" />
633633
<Button.ToolTip>
634634
<TextBlock Text="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Refresh}" />

RetailCoder.VBE/UI/CodeExplorer/Commands/CodeExplorer_RefreshCommand.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

RetailCoder.VBE/UI/Inspections/InspectionResultsViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4-
using System.Diagnostics;
54
using System.Globalization;
65
using System.IO;
76
using System.Linq;
@@ -216,7 +215,7 @@ private async void ExecuteRefreshCommandAsync(object parameter)
216215

217216
private bool CanExecuteRefreshCommand(object parameter)
218217
{
219-
return !IsBusy;
218+
return !IsBusy && _state.IsDirty();
220219
}
221220

222221
private async void _state_StateChanged(object sender, EventArgs e)

RetailCoder.VBE/UI/ToDoItems/ToDoExplorerViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public ICommand RefreshCommand
100100
return _refreshCommand = new DelegateCommand(_ =>
101101
{
102102
_state.OnParseRequested(this);
103-
});
103+
},
104+
_ => _state.IsDirty());
104105
}
105106
}
106107

RetailCoder.VBE/UI/UnitTesting/TestExplorerViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Rubberduck.UI.UnitTesting
1818
{
1919
public class TestExplorerViewModel : ViewModelBase, INavigateSelection, IDisposable
2020
{
21+
private readonly RubberduckParserState _state;
2122
private readonly ITestEngine _testEngine;
2223
private readonly TestExplorerModel _model;
2324
private readonly IClipboardWriter _clipboard;
@@ -34,6 +35,7 @@ public TestExplorerViewModel(VBE vbe,
3435
IGeneralConfigService configService,
3536
IOperatingSystem operatingSystem)
3637
{
38+
_state = state;
3739
_testEngine = testEngine;
3840
_testEngine.TestCompleted += TestEngineTestCompleted;
3941
_model = model;
@@ -220,7 +222,7 @@ private void ExecuteRefreshCommand(object parameter)
220222

221223
private bool CanExecuteRefreshCommand(object parameter)
222224
{
223-
return !Model.IsBusy;
225+
return !Model.IsBusy && _state.IsDirty();
224226
}
225227

226228
private void ExecuteRepeatLastRunCommand(object parameter)

0 commit comments

Comments
 (0)