diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-12 11:19:14 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-12 12:46:21 +1000 |
| commit | 148ad02da05070245c8345d6650e2a70bd4706be (patch) | |
| tree | 819c60d1c2b19848fb12bae9d9f7e009db387a43 /src/WixToolset.Core | |
| parent | 6d8b6f79b44b6a41a630aa3aad5a3c7f16701798 (diff) | |
| download | wix-148ad02da05070245c8345d6650e2a70bd4706be.tar.gz wix-148ad02da05070245c8345d6650e2a70bd4706be.tar.bz2 wix-148ad02da05070245c8345d6650e2a70bd4706be.zip | |
Merge and move default tuple logic from CreateOutputFromIRCommand to WindowsInstallerBackendHelper.
Diffstat (limited to 'src/WixToolset.Core')
| -rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs index 80179d1c..753b8b34 100644 --- a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Core.ExtensibilityServices | 3 | namespace WixToolset.Core.ExtensibilityServices |
| 4 | { | 4 | { |
| 5 | using System.Collections.Generic; | ||
| 6 | using System.Linq; | 5 | using System.Linq; |
| 7 | using WixToolset.Data; | 6 | using WixToolset.Data; |
| 8 | using WixToolset.Data.WindowsInstaller; | 7 | using WixToolset.Data.WindowsInstaller; |
| @@ -10,17 +9,25 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 10 | 9 | ||
| 11 | internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper | 10 | internal class WindowsInstallerBackendHelper : IWindowsInstallerBackendHelper |
| 12 | { | 11 | { |
| 13 | public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateTuple tuple, WindowsInstallerData output, IEnumerable<TableDefinition> tableDefinitions) | 12 | public Row CreateRow(IntermediateSection section, IntermediateTuple tuple, WindowsInstallerData output, TableDefinition tableDefinition) |
| 14 | { | 13 | { |
| 15 | var tableDefinition = tableDefinitions.FirstOrDefault(t => t.TupleDefinitionName == tuple.Definition.Name); | 14 | var table = output.EnsureTable(tableDefinition); |
| 15 | |||
| 16 | var row = table.CreateRow(tuple.SourceLineNumbers); | ||
| 17 | row.SectionId = section.Id; | ||
| 18 | |||
| 19 | return row; | ||
| 20 | } | ||
| 16 | 21 | ||
| 22 | public bool TryAddTupleToOutputMatchingTableDefinitions(IntermediateSection section, IntermediateTuple tuple, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) | ||
| 23 | { | ||
| 24 | var tableDefinition = tableDefinitions.FirstOrDefault(t => t.TupleDefinitionName == tuple.Definition.Name); | ||
| 17 | if (tableDefinition == null) | 25 | if (tableDefinition == null) |
| 18 | { | 26 | { |
| 19 | return false; | 27 | return false; |
| 20 | } | 28 | } |
| 21 | 29 | ||
| 22 | var table = output.EnsureTable(tableDefinition); | 30 | var row = this.CreateRow(section, tuple, output, tableDefinition); |
| 23 | var row = table.CreateRow(tuple.SourceLineNumbers); | ||
| 24 | var rowOffset = 0; | 31 | var rowOffset = 0; |
| 25 | 32 | ||
| 26 | if (tableDefinition.TupleIdIsPrimaryKey) | 33 | if (tableDefinition.TupleIdIsPrimaryKey) |
