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

Commit 706280c

Browse files
committed
Fix CA errors.
1 parent b04949a commit 706280c

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

src/GitHub.InlineReviews/Services/CommentService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.ComponentModel.Composition;
2+
using System.Globalization;
23
using System.Windows.Forms;
34

45
namespace GitHub.InlineReviews.Services
@@ -9,11 +10,17 @@ public class CommentService:ICommentService
910
{
1011
public bool ConfirmCommentDelete()
1112
{
13+
var options = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ?
14+
MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign :
15+
0;
16+
1217
return MessageBox.Show(
1318
VisualStudio.UI.Resources.DeleteCommentConfirmation,
1419
VisualStudio.UI.Resources.DeleteCommentConfirmationCaption,
1520
MessageBoxButtons.YesNo,
16-
MessageBoxIcon.Question) == DialogResult.Yes;
21+
MessageBoxIcon.Question,
22+
MessageBoxDefaultButton.Button1,
23+
options) == DialogResult.Yes;
1724
}
1825
}
1926
}

src/GitHub.TeamFoundation.14/Services/TeamExplorerServices.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.ComponentModel.Composition;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.Windows.Input;
45
using GitHub.Extensions;
56
using GitHub.VisualStudio.TeamExplorer.Sync;
@@ -19,7 +20,7 @@ public class TeamExplorerServices : ITeamExplorerServices
1920
/// that instances of this type cannot be created if the TeamFoundation dlls are not available
2021
/// (otherwise we'll have multiple instances of ITeamExplorerServices exports, and that would be Bad(tm))
2122
/// </summary>
22-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
23+
[SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
2324
ITeamExplorerNotificationManager manager;
2425

2526
[ImportingConstructor]
@@ -31,14 +32,14 @@ public TeamExplorerServices(IGitHubServiceProvider serviceProvider)
3132
public void ShowConnectPage()
3233
{
3334
var te = serviceProvider.TryGetService<ITeamExplorer>();
34-
var foo = te.NavigateToPage(new Guid(TeamExplorerPageIds.Connect), null);
35+
te.NavigateToPage(new Guid(TeamExplorerPageIds.Connect), null);
3536
}
3637

3738
public void ShowPublishSection()
3839
{
3940
var te = serviceProvider.TryGetService<ITeamExplorer>();
40-
var foo = te.NavigateToPage(new Guid(TeamExplorerPageIds.GitCommits), null);
41-
var publish = foo?.GetSection(new Guid(GitHubPublishSection.GitHubPublishSectionId)) as GitHubPublishSection;
41+
var page = te.NavigateToPage(new Guid(TeamExplorerPageIds.GitCommits), null);
42+
var publish = page?.GetSection(new Guid(GitHubPublishSection.GitHubPublishSectionId)) as GitHubPublishSection;
4243
publish?.Connect();
4344
}
4445

src/GitHub.VisualStudio/Commands/GoToSolutionOrPullRequestFileCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ bool TryNavigateFromHistoryFile(IVsTextView sourceView)
237237
if (teamExplorerContext.Value.ActiveRepository?.LocalPath is string repositoryDir &&
238238
FindObjectishForTFSTempFile(sourceView) is string objectish)
239239
{
240-
var (commitSha, blobPath) = gitHubContextService.Value.ResolveBlobFromHistory(repositoryDir, objectish);
240+
var (_, blobPath) = gitHubContextService.Value.ResolveBlobFromHistory(repositoryDir, objectish);
241241
if (blobPath is string)
242242
{
243243
var workingFile = Path.Combine(repositoryDir, blobPath);

src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand
2020
{
2121
readonly Lazy<IGitHubContextService> gitHubContextService;
2222
readonly Lazy<IRepositoryCloneService> repositoryCloneService;
23-
readonly Lazy<IPullRequestEditorService> pullRequestEditorService;
2423
readonly Lazy<ITeamExplorerContext> teamExplorerContext;
2524
readonly Lazy<IGitHubToolWindowManager> gitHubToolWindowManager;
2625
readonly Lazy<DTE> dte;
@@ -40,14 +39,12 @@ public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand
4039
public OpenFromUrlCommand(
4140
Lazy<IGitHubContextService> gitHubContextService,
4241
Lazy<IRepositoryCloneService> repositoryCloneService,
43-
Lazy<IPullRequestEditorService> pullRequestEditorService,
4442
Lazy<ITeamExplorerContext> teamExplorerContext,
4543
[Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) :
4644
base(CommandSet, CommandId)
4745
{
4846
this.gitHubContextService = gitHubContextService;
4947
this.repositoryCloneService = repositoryCloneService;
50-
this.pullRequestEditorService = pullRequestEditorService;
5148
this.teamExplorerContext = teamExplorerContext;
5249
this.serviceProvider = serviceProvider;
5350
dte = new Lazy<DTE>(() => (DTE)serviceProvider.GetService(typeof(DTE)));

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestListView.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace GitHub.VisualStudio.Views.GitHubPane
1919
{
20+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
2021
[ExportViewFor(typeof(IPullRequestListViewModel))]
2122
[PartCreationPolicy(CreationPolicy.NonShared)]
2223
public partial class PullRequestListView : UserControl

0 commit comments

Comments
 (0)