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

Commit 07f3dbe

Browse files
committed
Let ExportForProcess use default ContractType
There's no need to specify a contract interface when exporting a property.
1 parent e4bf7e1 commit 07f3dbe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/GitHub.Exports/Exports/ExportForProcess.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public sealed class ExportForProcessAttribute : ExportAttribute
2020
/// <summary>
2121
/// Define an export that is only exposed in a specific named process.
2222
/// </summary>
23-
/// <param name="contractType">The contract type to expose.</param>
2423
/// <param name="processName">Name of the process to expose export from (e.g. 'devenv').</param>
25-
public ExportForProcessAttribute(Type contractType, string processName) :
24+
/// <param name="contractType">The contract type to expose.</param>
25+
public ExportForProcessAttribute(string processName, Type contractType = null) :
2626
base(ContractNameForProcess(contractType, processName), contractType)
2727
{
2828
ProcessName = processName;

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ public ServiceProviderExports([Import(typeof(SVsServiceProvider))] IServiceProvi
119119
this.serviceProvider = serviceProvider;
120120
}
121121

122-
[ExportForProcess(typeof(ILoginManager), ProcessName)]
122+
[ExportForProcess(ProcessName)]
123123
public ILoginManager LoginManager => GetService<ILoginManager>();
124124

125-
[ExportForProcess(typeof(IGitHubServiceProvider), ProcessName)]
125+
[ExportForProcess(ProcessName)]
126126
public IGitHubServiceProvider GitHubServiceProvider => GetService<IGitHubServiceProvider>();
127127

128-
[ExportForProcess(typeof(IUsageTracker), ProcessName)]
128+
[ExportForProcess(ProcessName)]
129129
public IUsageTracker UsageTracker => GetService<IUsageTracker>();
130130

131-
[ExportForProcess(typeof(IVSGitExt), ProcessName)]
131+
[ExportForProcess(ProcessName)]
132132
public IVSGitExt VSGitExt => GetService<IVSGitExt>();
133133

134-
[ExportForProcess(typeof(IPackageSettings), ProcessName)]
134+
[ExportForProcess(ProcessName)]
135135
public IPackageSettings PackageSettings => GetService<IPackageSettings>();
136136

137137
T GetService<T>() => (T)serviceProvider.GetService(typeof(T));

0 commit comments

Comments
 (0)