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 --- .../StandardBackend.cs | 12 ------------ .../WindowsInstallerExtensionFactory.cs | 22 ++++++++++++++++++++++ .../WixToolsetStandardBackend.cs | 12 ++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) delete mode 100644 src/WixToolset.Core.WindowsInstaller/StandardBackend.cs create mode 100644 src/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionFactory.cs create mode 100644 src/WixToolset.Core.WindowsInstaller/WixToolsetStandardBackend.cs (limited to 'src/WixToolset.Core.WindowsInstaller') diff --git a/src/WixToolset.Core.WindowsInstaller/StandardBackend.cs b/src/WixToolset.Core.WindowsInstaller/StandardBackend.cs deleted file mode 100644 index f1ae2017..00000000 --- a/src/WixToolset.Core.WindowsInstaller/StandardBackend.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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 -{ - /// - /// Denotes this assembly contains a backend that is considered - /// a standard part of the WiX Toolset. - /// - public static class StandardBackend - { - } -} 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; + } + } +} diff --git a/src/WixToolset.Core.WindowsInstaller/WixToolsetStandardBackend.cs b/src/WixToolset.Core.WindowsInstaller/WixToolsetStandardBackend.cs new file mode 100644 index 00000000..3751cb54 --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/WixToolsetStandardBackend.cs @@ -0,0 +1,12 @@ +// 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 +{ + /// + /// Denotes this assembly contains a backend that is considered + /// a standard part of the WiX Toolset. + /// + public static class WixToolsetStandardBackend + { + } +} -- cgit v1.2.3-55-g6feb