aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Burn/BackendFactory.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-10-14 16:12:07 -0700
committerRob Mensching <rob@firegiant.com>2017-10-14 16:12:07 -0700
commitdbde9e7104b907bbbaea17e21247d8cafc8b3a4c (patch)
tree0f5fbbb6fe12c6b2e5e622a0e18ce4c5b4eb2b96 /src/WixToolset.Core.Burn/BackendFactory.cs
parentfbf986eb97f68396797a89fc7d40dec07b775440 (diff)
downloadwix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.gz
wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.bz2
wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.zip
Massive refactoring to introduce the concept of IBackend
Diffstat (limited to 'src/WixToolset.Core.Burn/BackendFactory.cs')
-rw-r--r--src/WixToolset.Core.Burn/BackendFactory.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/BackendFactory.cs b/src/WixToolset.Core.Burn/BackendFactory.cs
new file mode 100644
index 00000000..042fa254
--- /dev/null
+++ b/src/WixToolset.Core.Burn/BackendFactory.cs
@@ -0,0 +1,30 @@
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
3namespace WixToolset.Core.Burn
4{
5 using System;
6 using System.IO;
7 using WixToolset.Extensibility;
8
9 internal class BackendFactory : IBackendFactory
10 {
11 public bool TryCreateBackend(string outputType, string outputFile, IBindContext context, out IBackend backend)
12 {
13 if (String.IsNullOrEmpty(outputType))
14 {
15 outputType = Path.GetExtension(outputFile);
16 }
17
18 switch (outputType.ToLowerInvariant())
19 {
20 case "bundle":
21 case ".exe":
22 backend = new BundleBackend();
23 return true;
24 }
25
26 backend = null;
27 return false;
28 }
29 }
30}