| 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 Example.Extension |
| 4 | { |
| 5 | using System.Collections.Generic; |
| 6 | using WixToolset.Data; |
| 7 | using WixToolset.Data.WindowsInstaller; |
| 8 | using WixToolset.Extensibility; |
| 9 | |
| 10 | internal class ExampleWindowsInstallerBackendExtension : BaseWindowsInstallerBackendBinderExtension |
| 11 | { |
| 12 | public override IReadOnlyCollection<TableDefinition> TableDefinitions => ExampleTableDefinitions.All; |
| 13 | |
| 14 | public override bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) |
| 15 | { |
| 16 | if (ExampleSymbolDefinitions.TryGetSymbolType(symbol.Definition.Name, out var symbolType)) |
| 17 | { |
| 18 | switch (symbolType) |
| 19 | { |
| 20 | case ExampleSymbolDefinitionType.Example: |
| 21 | { |
| 22 | var row = (ExampleRow)this.BackendHelper.CreateRow(section, symbol, output, ExampleTableDefinitions.ExampleTable); |
| 23 | row.Example = symbol.Id.Id; |
| 24 | row.ComponentRef = symbol[0].AsString(); |
| 25 | row.Value = symbol[1].AsString(); |
| 26 | return true; |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | return base.TryProcessSymbol(section, symbol, output, tableDefinitions); |
| 32 | } |
| 33 | } |
| 34 | } |