diff options
author | Rob Mensching <rob@firegiant.com> | 2017-11-11 12:41:56 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-11-11 12:41:56 -0800 |
commit | b6bf1604c32259757f75b4c35444cfe4ecc21a86 (patch) | |
tree | eb573ffb95d99228dbb40968814ac3eaa01271f7 /src/WixToolset.Core.Burn/BurnBackendFactory.cs | |
parent | 9f8cb5374481b6c8a06eb2739858332350f72666 (diff) | |
download | wix-b6bf1604c32259757f75b4c35444cfe4ecc21a86.tar.gz wix-b6bf1604c32259757f75b4c35444cfe4ecc21a86.tar.bz2 wix-b6bf1604c32259757f75b4c35444cfe4ecc21a86.zip |
Introduce IExtensionFactory as mechanism to create extensions
Diffstat (limited to 'src/WixToolset.Core.Burn/BurnBackendFactory.cs')
-rw-r--r-- | src/WixToolset.Core.Burn/BurnBackendFactory.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/BurnBackendFactory.cs b/src/WixToolset.Core.Burn/BurnBackendFactory.cs new file mode 100644 index 00000000..8e2b3ce2 --- /dev/null +++ b/src/WixToolset.Core.Burn/BurnBackendFactory.cs | |||
@@ -0,0 +1,31 @@ | |||
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.Burn | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using WixToolset.Extensibility; | ||
8 | using WixToolset.Extensibility.Services; | ||
9 | |||
10 | internal class BurnBackendFactory : IBackendFactory | ||
11 | { | ||
12 | public bool TryCreateBackend(string outputType, string outputFile, IBindContext context, out IBackend backend) | ||
13 | { | ||
14 | if (String.IsNullOrEmpty(outputType)) | ||
15 | { | ||
16 | outputType = Path.GetExtension(outputFile); | ||
17 | } | ||
18 | |||
19 | switch (outputType.ToLowerInvariant()) | ||
20 | { | ||
21 | case "bundle": | ||
22 | case ".exe": | ||
23 | backend = new BundleBackend(); | ||
24 | return true; | ||
25 | } | ||
26 | |||
27 | backend = null; | ||
28 | return false; | ||
29 | } | ||
30 | } | ||
31 | } | ||