diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-29 11:44:46 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-29 11:46:53 +1000 |
| commit | 311dbab658184e603953791a075c776456226b95 (patch) | |
| tree | 7767f664492a11d1721b37200a0a45077222d3c6 /src/WixToolset.Data/WindowsInstaller/TableDefinition.cs | |
| parent | e25b29f5ded38e281f3a686bc5ce7cbe1d872d3b (diff) | |
| download | wix-311dbab658184e603953791a075c776456226b95.tar.gz wix-311dbab658184e603953791a075c776456226b95.tar.bz2 wix-311dbab658184e603953791a075c776456226b95.zip | |
Add overloads to WindowsInstallerData.Load for table definitions.
Diffstat (limited to 'src/WixToolset.Data/WindowsInstaller/TableDefinition.cs')
| -rw-r--r-- | src/WixToolset.Data/WindowsInstaller/TableDefinition.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs index 9ec37895..214544ca 100644 --- a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs | |||
| @@ -156,12 +156,16 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 156 | /// Parses table definition from xml reader. | 156 | /// Parses table definition from xml reader. |
| 157 | /// </summary> | 157 | /// </summary> |
| 158 | /// <param name="reader">Reader to get data from.</param> | 158 | /// <param name="reader">Reader to get data from.</param> |
| 159 | /// <param name="tableDefinitions">Table definitions to use for strongly-typed rows.</param> | ||
| 159 | /// <returns>The TableDefintion represented by the Xml.</returns> | 160 | /// <returns>The TableDefintion represented by the Xml.</returns> |
| 160 | internal static TableDefinition Read(XmlReader reader) | 161 | internal static TableDefinition Read(XmlReader reader, TableDefinitionCollection tableDefinitions) |
| 161 | { | 162 | { |
| 162 | var empty = reader.IsEmptyElement; | 163 | var empty = reader.IsEmptyElement; |
| 163 | string name = null; | 164 | string name = null; |
| 165 | IntermediateTupleDefinition tupleDefinition = null; | ||
| 164 | var unreal = false; | 166 | var unreal = false; |
| 167 | var tupleIdIsPrimaryKey = false; | ||
| 168 | Type strongRowType = null; | ||
| 165 | 169 | ||
| 166 | while (reader.MoveToNextAttribute()) | 170 | while (reader.MoveToNextAttribute()) |
| 167 | { | 171 | { |
| @@ -181,6 +185,13 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 181 | throw new XmlException(); | 185 | throw new XmlException(); |
| 182 | } | 186 | } |
| 183 | 187 | ||
| 188 | if (tableDefinitions.TryGet(name, out var tableDefinition)) | ||
| 189 | { | ||
| 190 | tupleDefinition = tableDefinition.TupleDefinition; | ||
| 191 | tupleIdIsPrimaryKey = tableDefinition.TupleIdIsPrimaryKey; | ||
| 192 | strongRowType = tableDefinition.StrongRowType; | ||
| 193 | } | ||
| 194 | |||
| 184 | var columns = new List<ColumnDefinition>(); | 195 | var columns = new List<ColumnDefinition>(); |
| 185 | var hasPrimaryKeyColumn = false; | 196 | var hasPrimaryKeyColumn = false; |
| 186 | 197 | ||
| @@ -226,7 +237,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 226 | } | 237 | } |
| 227 | } | 238 | } |
| 228 | 239 | ||
| 229 | return new TableDefinition(name, null, columns.ToArray(), unreal); | 240 | return new TableDefinition(name, tupleDefinition, columns.ToArray(), unreal, tupleIdIsPrimaryKey, strongRowType); |
| 230 | } | 241 | } |
| 231 | 242 | ||
| 232 | /// <summary> | 243 | /// <summary> |
