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

Commit

Permalink
Merge pull request #2515 from github/useCreateRepositoryDialog
Browse files Browse the repository at this point in the history
Change GitHub.TeamFoundation.16 version of TeamExplorerServices
  • Loading branch information
jcansdale authored May 22, 2020
2 parents 4b2ce02 + e0eeacf commit c56f7f2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 0 deletions.
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 comments on commit c56f7f2

Please sign in to comment.