From b6bf1604c32259757f75b4c35444cfe4ecc21a86 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 11 Nov 2017 12:41:56 -0800 Subject: Introduce IExtensionFactory as mechanism to create extensions --- .../WindowsInstallerExtensionFactory.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs (limited to 'src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs new file mode 100644 index 00000000..7b12fc8c --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs @@ -0,0 +1,22 @@ +// 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. + +namespace WixToolset.Core.WindowsInstaller +{ + using System; + using WixToolset.Extensibility; + + internal class WindowsInstallerExtensionFactory : IExtensionFactory + { + public bool TryCreateExtension(Type extensionType, out object extension) + { + extension = null; + + if (extensionType == typeof(IBackendFactory)) + { + extension = new WindowsInstallerBackendFactory(); + } + + return extension != null; + } + } +} -- cgit v1.2.3-55-g6feb