| 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.Converters |
| 4 | { |
| 5 | using System; |
| 6 | using WixToolset.Extensibility; |
| 7 | |
| 8 | internal class ConverterExtensionFactory : IExtensionFactory |
| 9 | { |
| 10 | public ConverterExtensionFactory(IServiceProvider serviceProvider) |
| 11 | { |
| 12 | this.ServiceProvider = serviceProvider; |
| 13 | } |
| 14 | |
| 15 | private IServiceProvider ServiceProvider { get; } |
| 16 | |
| 17 | public bool TryCreateExtension(Type extensionType, out object extension) |
| 18 | { |
| 19 | extension = null; |
| 20 | |
| 21 | if (extensionType == typeof(IExtensionCommandLine)) |
| 22 | { |
| 23 | extension = new ConverterExtensionCommandLine(this.ServiceProvider); |
| 24 | } |
| 25 | |
| 26 | return extension != null; |
| 27 | } |
| 28 | } |
| 29 | } |