diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-02 21:00:43 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-02 21:34:24 +1000 |
commit | 7027e259b8987e425362ee8248e5d0efe8003d51 (patch) | |
tree | 7745b9055aecb9817bfa51576c81dd7efc38c019 /src/test/Example.Extension/ExampleExtensionFactory.cs | |
parent | 177784c9a6d93eeb3c195e6d62b97eb4c1dde32b (diff) | |
download | wix-7027e259b8987e425362ee8248e5d0efe8003d51.tar.gz wix-7027e259b8987e425362ee8248e5d0efe8003d51.tar.bz2 wix-7027e259b8987e425362ee8248e5d0efe8003d51.zip |
Hide the concrete implementation of the service provider interfaces
by adding WixToolsetServiceProviderFactory.
This forces consumers to code to the interfaces.
Diffstat (limited to 'src/test/Example.Extension/ExampleExtensionFactory.cs')
-rw-r--r-- | src/test/Example.Extension/ExampleExtensionFactory.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/Example.Extension/ExampleExtensionFactory.cs b/src/test/Example.Extension/ExampleExtensionFactory.cs index ee9641a2..e54561ee 100644 --- a/src/test/Example.Extension/ExampleExtensionFactory.cs +++ b/src/test/Example.Extension/ExampleExtensionFactory.cs | |||
@@ -4,12 +4,13 @@ namespace Example.Extension | |||
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility; |
7 | using WixToolset.Extensibility.Services; | ||
7 | 8 | ||
8 | public class ExampleExtensionFactory : IExtensionFactory | 9 | public class ExampleExtensionFactory : IExtensionFactory |
9 | { | 10 | { |
10 | private ExamplePreprocessorExtensionAndCommandLine preprocessorExtension; | 11 | private ExamplePreprocessorExtensionAndCommandLine preprocessorExtension; |
11 | 12 | ||
12 | public ExampleExtensionFactory(IServiceProvider serviceProvider) | 13 | public ExampleExtensionFactory(IWixToolsetCoreServiceProvider serviceProvider) |
13 | { | 14 | { |
14 | this.ServiceProvider = serviceProvider; | 15 | this.ServiceProvider = serviceProvider; |
15 | } | 16 | } |
@@ -17,7 +18,7 @@ namespace Example.Extension | |||
17 | /// <summary> | 18 | /// <summary> |
18 | /// This exists just to show it is possible to get a service provider to the extension factory. | 19 | /// This exists just to show it is possible to get a service provider to the extension factory. |
19 | /// </summary> | 20 | /// </summary> |
20 | private IServiceProvider ServiceProvider { get; } | 21 | private IWixToolsetCoreServiceProvider ServiceProvider { get; } |
21 | 22 | ||
22 | public bool TryCreateExtension(Type extensionType, out object extension) | 23 | public bool TryCreateExtension(Type extensionType, out object extension) |
23 | { | 24 | { |