8000 Change GitHub.TeamFoundation.16 version of TeamExplorerServices · Pull Request #2515 · github/VisualStudio · GitHub
[go: up one dir, main page]

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

Change GitHub.TeamFoundation.16 version of TeamExplorerServices #2515

Merged
merged 3 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
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
Binary file modified lib/16.0/Microsoft.TeamFoundation.Client.dll
Binary file not shown.
Binary file modified lib/16.0/Microsoft.TeamFoundation.Common.dll
Binary file not shown.
Binary file modified lib/16.0/Microsoft.TeamFoundation.Controls.dll
Binary file not shown.
Binary file modified lib/16.0/Microsoft.TeamFoundation.Git.Client.dll
Binary file not shown.
Binary file modified lib/16.0/Microsoft.TeamFoundation.Git.Controls.dll
Binary file not shown.
Binary file modified lib/16.0/Microsoft.TeamFoundation.Git.Provider.dll
Binary file not shown.
25 changes: 25 additions & 0 deletions src/GitHub.TeamFoundation.14/Services/TeamExplorerServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using EnvDTE;
using GitHub.VisualStudio.TeamExplorer.Sync;
using Microsoft.TeamFoundation.Controls;
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
using ReactiveUI;

namespace GitHub.Services
Expand Down Expand Up @@ -66,12 +67,36 @@ public void ShowHomePage()

public void ShowPublishSection()
{
#if TEAMEXPLORER16
// Only call InitializeOrPushRepositoryToGitService when IGitActionsExt2 exists
if (FindIGitActionsExt2() is object)
{
InitializeOrPushRepositoryToGitService();
return;
}
#endif

var te = serviceProvider.TryGetService<ITeamExplorer>();
var page = te.NavigateToPage(new Guid(TeamExplorerPageIds.GitCommits), null);
var publish = page?.GetSection(new Guid(GitHubPublishSection.GitHubPublishSectionId)) as GitHubPublishSection;
publish?.Connect();
}

#if TEAMEXPLORER16
private static Type FindIGitActionsExt2()
{
Type type = typeof(IGitActionsExt);
string name = $"{type.FullName}2";
return type.Assembly.GetType(name, false);
}

private void InitializeOrPushRepositoryToGitService()
{
IGitActionsExt2 gitActionsExt = serviceProvider.TryGetService<IGitActionsExt2>();
gitActionsExt?.InitializeOrPushRepositoryToGitService();
}
#endif

public async Task ShowRepositorySettingsRemotesAsync()
{
var te = serviceProvider.TryGetService<ITeamExplorer>();
Expand Down
0