From 720c4a0db1a2fb2aa3e08e5c99d5198873e448ba Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 1 Dec 2017 01:09:42 -0800 Subject: Introduce ExampleExtension for testing --- .../Example.Extension/ExampleExtensionFactory.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/test/Example.Extension/ExampleExtensionFactory.cs (limited to 'src/test/Example.Extension/ExampleExtensionFactory.cs') diff --git a/src/test/Example.Extension/ExampleExtensionFactory.cs b/src/test/Example.Extension/ExampleExtensionFactory.cs new file mode 100644 index 00000000..9539ee85 --- /dev/null +++ b/src/test/Example.Extension/ExampleExtensionFactory.cs @@ -0,0 +1,32 @@ +// 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 Example.Extension +{ + using System; + using WixToolset.Extensibility; + + public class ExampleExtensionFactory : IExtensionFactory + { + public bool TryCreateExtension(Type extensionType, out object extension) + { + if (extensionType == typeof(IPreprocessorExtension)) + { + extension = new ExamplePreprocessorExtension(); + } + else if (extensionType == typeof(ICompilerExtension)) + { + extension = new ExampleCompilerExtension(); + } + else if (extensionType == typeof(IExtensionData)) + { + extension = new ExampleExtensionData(); + } + else + { + extension = null; + } + + return extension != null; + } + } +} -- cgit v1.2.3-55-g6feb