| 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 WixToolset.Extensibility; |
| 6 | using WixToolset.Extensibility.Data; |
| 7 | using WixToolset.Extensibility.Services; |
| 8 | |
| 9 | internal class BundleBackend : IBackend |
| 10 | { |
| 11 | public IBindResult Bind(IBindContext context) |
| 12 | { |
| 13 | var extensionManager = context.ServiceProvider.GetService<IExtensionManager>(); |
| 14 | |
| 15 | var backendExtensions = extensionManager.GetServices<IBurnBackendBinderExtension>(); |
| 16 | |
| 17 | foreach (var extension in backendExtensions) |
| 18 | { |
| 19 | extension.PreBackendBind(context); |
| 20 | } |
| 21 | |
| 22 | var command = new BindBundleCommand(context, backendExtensions); |
| 23 | command.Execute(); |
| 24 | |
| 25 | var result = context.ServiceProvider.GetService<IBindResult>(); |
| 26 | result.FileTransfers = command.FileTransfers; |
| 27 | result.TrackedFiles = command.TrackedFiles; |
| 28 | result.Wixout = command.Wixout; |
| 29 | |
| 30 | foreach (var extension in backendExtensions) |
| 31 | { |
| 32 | extension.PostBackendBind(result); |
| 33 | } |
| 34 | |
| 35 | return result; |
| 36 | } |
| 37 | } |
| 38 | } |