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

Commit b98cc52

Browse files
committed
Merge VSGitExtDispatcher into VSGitExtFactory
1 parent e517687 commit b98cc52

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@
329329
<Compile Include="Services\LoginManagerDispatcher.cs" />
330330
<Compile Include="Services\UsageTrackerDispatcher.cs" />
331331
<Compile Include="Services\VSGitExtFactory.cs" />
332-
<Compile Include="Services\VSGitExtDispatcher.cs" />
333332
<Compile Include="Settings\Constants.cs" />
334333
<Compile Include="Services\ConnectionManager.cs" />
335334
<Compile Include="Services\Program.cs" />

src/GitHub.VisualStudio/Services/VSGitExtDispatcher.cs

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

src/GitHub.VisualStudio/Services/VSGitExtFactory.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extern alias TF15;
33

44
using System;
5+
using System.ComponentModel.Composition;
56
using GitHub.Logging;
67
using Serilog;
78
using VSGitExt14 = TF14.GitHub.VisualStudio.Base.VSGitExt;
@@ -10,10 +11,22 @@
1011

1112
namespace GitHub.Services
1213
{
14+
[PartCreationPolicy(CreationPolicy.Shared)]
1315
public class VSGitExtFactory
1416
{
1517
static readonly ILogger log = LogManager.ForContext<VSGitExtFactory>();
1618

19+
readonly IGitHubServiceProvider serviceProvider;
20+
21+
[ImportingConstructor]
22+
public VSGitExtFactory(IGitHubServiceProvider serviceProvider)
23+
{
24+
this.serviceProvider = serviceProvider;
25+
}
26+
27+
[Export(typeof(IVSGitExt))]
28+
public IVSGitExt VSGitExt => serviceProvider.GetService<IVSGitExt>();
29+
1730
public static IVSGitExt Create(string dteVersion, IAsyncServiceProvider sp)
1831
{
1932
// DTE.Version always ends with ".0" even for later minor versions.

0 commit comments

Comments
 (0)