diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-08 16:26:59 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-08 16:37:14 -0700 |
| commit | 02cdf55197d599d4d1fd611ad749d01f5c47a01f (patch) | |
| tree | 76fcd573827fdb6b142197baa3237e6310a7bd4d /src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs | |
| parent | 04b8976ca565ce95cf32a58c8725843618724383 (diff) | |
| download | wix-02cdf55197d599d4d1fd611ad749d01f5c47a01f.tar.gz wix-02cdf55197d599d4d1fd611ad749d01f5c47a01f.tar.bz2 wix-02cdf55197d599d4d1fd611ad749d01f5c47a01f.zip | |
Add "extension" command
Diffstat (limited to 'src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs')
| -rw-r--r-- | src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs new file mode 100644 index 00000000..44fc4b86 --- /dev/null +++ b/src/WixToolset.Core.ExtensionCache/ExtensionCacheManagerExtensionFactory.cs | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Core.ExtensionCache | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using WixToolset.Extensibility; | ||
| 7 | using WixToolset.Extensibility.Services; | ||
| 8 | |||
| 9 | internal class ExtensionCacheManagerExtensionFactory : IExtensionFactory | ||
| 10 | { | ||
| 11 | public ExtensionCacheManagerExtensionFactory(IWixToolsetServiceProvider serviceProvider) | ||
| 12 | { | ||
| 13 | this.ServiceProvider = serviceProvider; | ||
| 14 | } | ||
| 15 | |||
| 16 | private IWixToolsetServiceProvider ServiceProvider { get; } | ||
| 17 | |||
| 18 | public bool TryCreateExtension(Type extensionType, out object extension) | ||
| 19 | { | ||
| 20 | extension = null; | ||
| 21 | |||
| 22 | if (extensionType == typeof(IExtensionCommandLine)) | ||
| 23 | { | ||
| 24 | extension = new ExtensionCacheManagerExtensionCommandLine(this.ServiceProvider); | ||
| 25 | } | ||
| 26 | |||
| 27 | return extension != null; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||
