diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-02-05 14:33:15 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-02-05 14:43:36 -0800 |
| commit | 2b001acb812edb523a072ac0bb4f49761616c080 (patch) | |
| tree | ba2900efc6ead2e86d4dff585e8aa3782ed05bc7 /src | |
| parent | 7d8b84ebde2940b693462ca8ef22117fe6b9420c (diff) | |
| download | wix-2b001acb812edb523a072ac0bb4f49761616c080.tar.gz wix-2b001acb812edb523a072ac0bb4f49761616c080.tar.bz2 wix-2b001acb812edb523a072ac0bb4f49761616c080.zip | |
Add support for unreal columns
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs | 20 | ||||
| -rw-r--r-- | src/WixToolset.Data/WindowsInstaller/TableDefinition.cs | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs b/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs index 1cbad230..de554fd8 100644 --- a/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/ColumnDefinition.cs | |||
| @@ -29,7 +29,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 29 | /// <param name="modularizeType">Type of modularization for column</param> | 29 | /// <param name="modularizeType">Type of modularization for column</param> |
| 30 | /// <param name="forceLocalizable">If the column is localizable.</param> | 30 | /// <param name="forceLocalizable">If the column is localizable.</param> |
| 31 | /// <param name="useCData">If whitespace should be preserved in a CDATA node.</param> | 31 | /// <param name="useCData">If whitespace should be preserved in a CDATA node.</param> |
| 32 | public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false) | 32 | public ColumnDefinition(string name, ColumnType type, int length, bool primaryKey, bool nullable, ColumnCategory category, long? minValue = null, long? maxValue = null, string keyTable = null, int? keyColumn = null, string possibilities = null, string description = null, ColumnModularizeType? modularizeType = null, bool forceLocalizable = false, bool useCData = false, bool unreal = false) |
| 33 | { | 33 | { |
| 34 | this.Name = name; | 34 | this.Name = name; |
| 35 | this.Type = type; | 35 | this.Type = type; |
| @@ -46,6 +46,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 46 | this.Possibilities = possibilities; | 46 | this.Possibilities = possibilities; |
| 47 | this.Description = description; | 47 | this.Description = description; |
| 48 | this.UseCData = useCData; | 48 | this.UseCData = useCData; |
| 49 | this.Unreal = unreal; | ||
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | /// <summary> | 52 | /// <summary> |
| @@ -146,6 +147,12 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 146 | public bool UseCData { get; } | 147 | public bool UseCData { get; } |
| 147 | 148 | ||
| 148 | /// <summary> | 149 | /// <summary> |
| 150 | /// Gets if column is Unreal. | ||
| 151 | /// </summary> | ||
| 152 | /// <value>true if column should not be included in idts.</value> | ||
| 153 | public bool Unreal { get; } | ||
| 154 | |||
| 155 | /// <summary> | ||
| 149 | /// Parses a column definition in a table definition. | 156 | /// Parses a column definition in a table definition. |
| 150 | /// </summary> | 157 | /// </summary> |
| 151 | /// <param name="reader">Reader to get data from.</param> | 158 | /// <param name="reader">Reader to get data from.</param> |
| @@ -174,6 +181,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 174 | bool primaryKey = false; | 181 | bool primaryKey = false; |
| 175 | var type = ColumnType.Unknown; | 182 | var type = ColumnType.Unknown; |
| 176 | bool useCData = false; | 183 | bool useCData = false; |
| 184 | bool unreal = false; | ||
| 177 | 185 | ||
| 178 | // parse the attributes | 186 | // parse the attributes |
| 179 | while (reader.MoveToNextAttribute()) | 187 | while (reader.MoveToNextAttribute()) |
| @@ -370,6 +378,9 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 370 | case "useCData": | 378 | case "useCData": |
| 371 | useCData = reader.Value.Equals("yes"); | 379 | useCData = reader.Value.Equals("yes"); |
| 372 | break; | 380 | break; |
| 381 | case "unreal": | ||
| 382 | unreal = reader.Value.Equals("yes"); | ||
| 383 | break; | ||
| 373 | } | 384 | } |
| 374 | } | 385 | } |
| 375 | 386 | ||
| @@ -396,7 +407,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 396 | } | 407 | } |
| 397 | } | 408 | } |
| 398 | 409 | ||
| 399 | ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData); | 410 | ColumnDefinition columnDefinition = new ColumnDefinition(name, type, length, primaryKey, nullable, category, minValue, maxValue, keyTable, keyColumn, possibilities, description, modularize, localizable, useCData, unreal); |
| 400 | columnDefinition.Added = added; | 411 | columnDefinition.Added = added; |
| 401 | 412 | ||
| 402 | return columnDefinition; | 413 | return columnDefinition; |
| @@ -601,6 +612,11 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 601 | writer.WriteAttributeString("useCData", "yes"); | 612 | writer.WriteAttributeString("useCData", "yes"); |
| 602 | } | 613 | } |
| 603 | 614 | ||
| 615 | if (this.Unreal) | ||
| 616 | { | ||
| 617 | writer.WriteAttributeString("unreal", "yes"); | ||
| 618 | } | ||
| 619 | |||
| 604 | writer.WriteEndElement(); | 620 | writer.WriteEndElement(); |
| 605 | } | 621 | } |
| 606 | 622 | ||
diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs index ee8ab0c1..4738ac82 100644 --- a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs | |||
| @@ -88,6 +88,12 @@ namespace WixToolset.Data.WindowsInstaller | |||
| 88 | var thisColumnDef = this.Columns[i]; | 88 | var thisColumnDef = this.Columns[i]; |
| 89 | var updatedColumnDef = updated.Columns[i]; | 89 | var updatedColumnDef = updated.Columns[i]; |
| 90 | 90 | ||
| 91 | // Igmore unreal columns when comparing table definitions. | ||
| 92 | if (thisColumnDef.Unreal || updatedColumnDef.Unreal) | ||
| 93 | { | ||
| 94 | continue; | ||
| 95 | } | ||
| 96 | |||
| 91 | ret = thisColumnDef.CompareTo(updatedColumnDef); | 97 | ret = thisColumnDef.CompareTo(updatedColumnDef); |
| 92 | } | 98 | } |
| 93 | } | 99 | } |
