Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit e0fc71a

Browse files
author
Steven Kirk
committed
Couple of renames.
1 parent f6c24db commit e0fc71a

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/GitHub.App/SampleData/PullRequestDetailViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public PullRequestDetailViewModelDesigner()
7373

7474
public ReactiveCommand<Unit> Checkout { get; }
7575
public ReactiveCommand<object> OpenOnGitHub { get; }
76-
public ReactiveCommand<object> OpenFile { get; }
76+
public ReactiveCommand<object> ActivateItem { get; }
7777
public ReactiveCommand<object> ToggleChangedFilesView { get; }
7878
public ReactiveCommand<object> ToggleOpenChangedFileAction { get; }
7979
public ReactiveCommand<object> ViewOpenFile { get; }

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public IObservable<string> GetPullRequestTemplate(ILocalRepositoryModel reposito
8484
});
8585
}
8686

87-
public IObservable<bool> CleanForCheckout(ILocalRepositoryModel repository)
87+
public IObservable<bool> IsCleanForCheckout(ILocalRepositoryModel repository)
8888
{
8989
var repo = gitService.GetRepository(repository.LocalPath);
9090
return Observable.Return(!repo.RetrieveStatus().IsDirty);

src/GitHub.App/ViewModels/PullRequestDetailViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public PullRequestDetailViewModel(
9797
Checkout = ReactiveCommand.CreateAsyncObservable(canCheckout, DoCheckout);
9898

9999
OpenOnGitHub = ReactiveCommand.Create();
100-
OpenFile = ReactiveCommand.Create();
101-
OpenFile.Subscribe(x => DoOpenFile((IPullRequestFileViewModel)x));
100+
ActivateItem = ReactiveCommand.Create();
101+
ActivateItem.Subscribe(x => DoOpenFile((IPullRequestFileViewModel)x));
102102

103103
ToggleChangedFilesView = ReactiveCommand.Create();
104104
ToggleChangedFilesView.Subscribe(_ =>
@@ -281,7 +281,7 @@ public string CheckoutDisabledMessage
281281
/// Execute method. It triggers <see cref="ViewOpenFile"/> or <see cref="ViewCompareFiles"/> which
282282
/// should be handled by the view to implement opening or comparing the file.
283283
/// </remarks>
284-
public ReactiveCommand<object> OpenFile { get; }
284+
public ReactiveCommand<object> ActivateItem { get; }
285285

286286
/// <summary>
287287
/// Gets a command that toggles the <see cref="ChangedFilesView"/> property.
@@ -387,7 +387,7 @@ public async Task Load(PullRequest pullRequest, IList<PullRequestFile> files)
387387
CheckoutMode = CheckoutMode.Fetch;
388388
}
389389

390-
var clean = await pullRequestsService.CleanForCheckout(repository);
390+
var clean = await pullRequestsService.IsCleanForCheckout(repository);
391391

392392
CheckoutDisabledMessage = (!clean && CheckoutMode != CheckoutMode.UpToDate) ?
393393
$"Cannot {GetCheckoutModeDescription(CheckoutMode)} as your working directory has uncommitted changes." :

src/GitHub.Exports.Reactive/Services/IPullRequestService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host,
1818
/// </summary>
1919
/// <param name="repository">The repository.</param>
2020
/// <returns></returns>
21-
IObservable<bool> CleanForCheckout(ILocalRepositoryModel repository);
21+
IObservable<bool> IsCleanForCheckout(ILocalRepositoryModel repository);
2222

2323
/// <summary>
2424
/// Fetches a pull request to a local branch and checks out the branch.

src/GitHub.Exports.Reactive/ViewModels/IPullRequestDetailViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public interface IPullRequestDetailViewModel : IViewModel, IHasBusy
184184
/// Execute method. It triggers <see cref="ViewOpenFile"/> or <see cref="ViewCompareFiles"/> which
185185
/// should be handled by the view to implement opening or comparing the file.
186186
/// </remarks>
187-
ReactiveCommand<object> OpenFile { get; }
187+
ReactiveCommand<object> ActivateItem { get; }
188188

189189
/// <summary>
190190
/// Gets a command that toggles the <see cref="ChangedFilesView"/> property.

src/GitHub.VisualStudio/UI/Views/PullRequestDetailView.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private void FileListMouseDoubleClick(object sender, MouseButtonEventArgs e)
122122

123123
if (file != null)
124124
{
125-
ViewModel.OpenFile.Execute(file);
125+
ViewModel.ActivateItem.Execute(file);
126126
}
127127
}
128128
}

src/UnitTests/GitHub.App/ViewModels/PullRequestDetailViewModelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Tuple<PullRequestDetailViewModel, IPullRequestService> CreateTargetAndService(
328328
}
329329

330330
pullRequestService.IsPullRequestFromFork(repository, Arg.Any<PullRequest>()).Returns(prFromFork);
331-
pullRequestService.CleanForCheckout(repository).Returns(Observable.Return(!dirty));
331+
pullRequestService.IsCleanForCheckout(repository).Returns(Observable.Return(!dirty));
332332

333333
var divergence = Substitute.For<HistoryDivergence>();
334334
divergence.AheadBy.Returns(aheadBy);

0 commit comments

Comments
 (0)