@joebigelow / wix-1 / commits / ff99718c

To make it easier to associate tuples with tables...

...add TupleDefinitionName to TableDefinition.

Bob Arnson committed Mar 4, 2020 at 18:58 UTC ff99718c7f6dd09b6d42c9ef201955cedd81ad86
1 file changed +24 -2
src/WixToolset.Data/WindowsInstaller/TableDefinition.cs
+24 -2
@@ -27,17 +27,35 @@ namespace WixToolset.Data.WindowsInstaller
27 public TableDefinition(string name, IEnumerable<ColumnDefinition> columns, bool unreal = false)
28 {
29 this.Name = name;
30 + this.TupleDefinitionName = name;
31 this.Unreal = unreal;
31 -
32 this.Columns = columns.ToArray();
33 }
34
35 + /// <summary>
36 + /// Creates a table definition.
37 + /// </summary>
38 + /// <param name="name">Name of table to create.</param>
39 + /// <param name="tupleDefinitionName">Optional name of tuple definition for this table.</param>
40 + /// <param name="columns">Column definitions for the table.</param>
41 + /// <param name="unreal">Flag if table is unreal.</param>
42 + public TableDefinition(string name, string tupleDefinitionName, IEnumerable<ColumnDefinition> columns, bool unreal = false) : this(name, columns, unreal)
43 + {
44 + this.TupleDefinitionName = tupleDefinitionName ?? name;
45 + }
46 +
47 /// <summary>
48 /// Gets the name of the table.
49 /// </summary>
50 /// <value>Name of the table.</value>
51 public string Name { get; private set; }
52
53 + /// <summary>
54 + /// Gets the name of the tuple definition associated with this table.
55 + /// </summary>
56 + /// <value>Name of the tuple definition.</value>
57 + public string TupleDefinitionName { get; private set; }
58 +
59 /// <summary>
60 /// Gets if the table is unreal.
61 /// </summary>
@@ -110,6 +128,7 @@ namespace WixToolset.Data.WindowsInstaller
128 {
129 var empty = reader.IsEmptyElement;
130 string name = null;
131 + string tupleDefinitionName = null;
132 var unreal = false;
133 var bootstrapperApplicationData = false;
134
@@ -120,6 +139,9 @@ namespace WixToolset.Data.WindowsInstaller
139 case "name":
140 name = reader.Value;
141 break;
142 + case "tupleDefinitionName":
143 + tupleDefinitionName = reader.Value;
144 + break;
145 case "unreal":
146 unreal = reader.Value.Equals("yes");
147 break;
@@ -176,7 +198,7 @@ namespace WixToolset.Data.WindowsInstaller
198 }
199 }
200
179 - return new TableDefinition(name, columns.ToArray(), unreal);
201 + return new TableDefinition(name, tupleDefinitionName, columns.ToArray(), unreal);
202 }
203
204 /// <summary>