aboutsummaryrefslogtreecommitdiff
path: root/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-04-18 14:43:31 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-04-18 21:31:28 +1000
commita6091afa5bd24fe65e7fc20f179ed888301afdf8 (patch)
tree020cf8336d4f282bac818d2d7a5d2a6b0ae10ff0 /src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
parentc7f9ef7e7bcceb670b56a70fc9aa92152fd55573 (diff)
downloadwix-a6091afa5bd24fe65e7fc20f179ed888301afdf8.tar.gz
wix-a6091afa5bd24fe65e7fc20f179ed888301afdf8.tar.bz2
wix-a6091afa5bd24fe65e7fc20f179ed888301afdf8.zip
Test ability for an extension to have a custom strongly typed row during binding.
Diffstat (limited to 'src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs')
-rw-r--r--src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
index 4ee682d3..2818cde4 100644
--- a/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
+++ b/src/test/Example.Extension/ExampleWindowsInstallerBackendExtension.cs
@@ -13,22 +13,21 @@ namespace Example.Extension
13 13
14 public override bool TryAddTupleToOutput(IntermediateSection section, IntermediateTuple tuple, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) 14 public override bool TryAddTupleToOutput(IntermediateSection section, IntermediateTuple tuple, WindowsInstallerData output, TableDefinitionCollection tableDefinitions)
15 { 15 {
16#if ALTERNATIVE_TO_USING_HELPER 16 if (ExampleTupleDefinitions.TryGetTupleType(tuple.Definition.Name, out var tupleType))
17 switch (tuple.Definition.Name)
18 { 17 {
19 case ExampleTupleDefinitions.ExampleName: 18 switch (tupleType)
20 { 19 {
21 var row = this.BackendHelper.CreateRow(section, tuple, output, ExampleTableDefinitions.ExampleTable); 20 case ExampleTupleDefinitionType.Example:
22 row[0] = tuple[0].AsString(); 21 {
23 row[1] = tuple[1].AsString(); 22 var row = (ExampleRow)this.BackendHelper.CreateRow(section, tuple, output, ExampleTableDefinitions.ExampleTable);
24 } 23 row.Example = tuple.Id.Id;
25 return true; 24 row.Value = tuple[0].AsString();
25 }
26 return true;
27 }
26 } 28 }
27 29
28 return false;
29#else
30 return this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(section, tuple, output, tableDefinitions); 30 return this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(section, tuple, output, tableDefinitions);
31#endif
32 } 31 }
33 } 32 }
34} 33}