From 68075faa4a60e8016ea7653cfc1396cd00e3f646 Mon Sep 17 00:00:00 2001 From: Rob Mensching <rob@firegiant.com> Date: Wed, 27 Dec 2017 14:23:39 -0800 Subject: Integrate latest Data and Extensibility changes and build light.exe --- src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs | 4 ++-- .../Bind/CreateOutputFromIRCommand.cs | 2 +- .../Bind/GenerateDatabaseCommand.cs | 4 ++-- src/WixToolset.Core.WindowsInstaller/Bind/ModularaizeCommand.cs | 2 +- .../Unbind/UnbindDatabaseCommand.cs | 6 +++--- .../Unbind/UnbindTranformCommand.cs | 4 ++-- .../ExtensibilityServices/WindowsInstallerBackendHelper.cs | 2 +- src/test/TestData/Example.Extension/ExampleCompilerExtension.cs | 5 +---- src/test/TestData/Example.Extension/ExampleTableDefinitions.cs | 2 +- 9 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs index 9afb3260..6b1dead5 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs @@ -69,9 +69,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind return; } - if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Count) + if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Length) { - throw new WixException(ErrorMessages.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); + throw new WixException(ErrorMessages.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Length, TableDefinition.MaxColumnsInRealTable)); } // Tack on the table header, and flush before we start writing bytes directly to the stream. diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 0642d217..ac770823 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -254,7 +254,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var row = table.CreateRow(tuple.SourceLineNumbers); for (var i = 0; i < tuple.Fields.Length; ++i) { - if (i < tableDefinition.Columns.Count) + if (i < tableDefinition.Columns.Length) { var column = tableDefinition.Columns[i]; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index cc920ac2..3357db3e 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs @@ -219,7 +219,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Import each row containing a stream foreach (Row row in table.Rows) { - using (Record record = new Record(table.Definition.Columns.Count)) + using (Record record = new Record(table.Definition.Columns.Length)) { StringBuilder streamName = new StringBuilder(); bool needStream = false; @@ -230,7 +230,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind streamName.Append(table.Name); } - for (int i = 0; i < table.Definition.Columns.Count; i++) + for (int i = 0; i < table.Definition.Columns.Length; i++) { ColumnDefinition columnDefinition = table.Definition.Columns[i]; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ModularaizeCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ModularaizeCommand.cs index 03538fc3..8c6e3831 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ModularaizeCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ModularaizeCommand.cs @@ -48,7 +48,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var modularizedColumns = new List<int>(); // find the modularized columns - for (var i = 0; i < table.Definition.Columns.Count; ++i) + for (var i = 0; i < table.Definition.Columns.Length; ++i) { if (ColumnModularizeType.None != table.Definition.Columns[i].ModularizeType) { diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs index 5d24d08a..f4e05489 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs @@ -127,7 +127,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind using (View tableView = this.Database.OpenExecuteView(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM `{0}`", tableName))) { - List<ColumnDefinition> columns; + ColumnDefinition[] columns; using (Record columnNameRecord = tableView.GetColumnInfo(MsiInterop.MSICOLINFONAMES), columnTypeRecord = tableView.GetColumnInfo(MsiInterop.MSICOLINFOTYPES)) { @@ -144,7 +144,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind } int columnCount = columnNameRecord.GetFieldCount(); - columns = new List<ColumnDefinition>(columnCount); + columns = new ColumnDefinition[columnCount]; for (int i = 1; i <= columnCount; i++) { string columnName = columnNameRecord.GetString(i); @@ -260,7 +260,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind columnModularizeType = ColumnModularizeType.Column; } - columns.Add(new ColumnDefinition(columnName, columnType, length, primary, nullable, columnCategory, minValue, maxValue, keyTable, keyColumn, set, description, columnModularizeType, (ColumnType.Localized == columnType), true)); + columns[i - 1] = new ColumnDefinition(columnName, columnType, length, primary, nullable, columnCategory, minValue, maxValue, keyTable, keyColumn, set, description, columnModularizeType, (ColumnType.Localized == columnType), true); } } diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs index 00e5a755..80401822 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs @@ -212,7 +212,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind // mark the field as modified int indexOfModifiedValue = -1; - for (int i = 0; i < modifiedRow.TableDefinition.Columns.Count; ++i) + for (int i = 0; i < modifiedRow.TableDefinition.Columns.Length; ++i) { if (columnName.Equals(modifiedRow.TableDefinition.Columns[i].Name, StringComparison.Ordinal)) { @@ -270,7 +270,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind string[] primaryKeyParts = primaryKeys.Split('\t'); int primaryKeyPartIndex = 0; - for (int i = 0; i < table.Definition.Columns.Count; i++) + for (int i = 0; i < table.Definition.Columns.Length; i++) { ColumnDefinition columnDefinition = table.Definition.Columns[i]; diff --git a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs index 3b41fdf1..6e0ffce6 100644 --- a/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/WindowsInstallerBackendHelper.cs @@ -30,7 +30,7 @@ namespace WixToolset.Core.ExtensibilityServices var row = table.CreateRow(tuple.SourceLineNumbers); for (var i = 0; i < tuple.Fields.Length; ++i) { - if (i < tableDefinition.Columns.Count) + if (i < tableDefinition.Columns.Length) { var column = tableDefinition.Columns[i]; diff --git a/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs b/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs index 5b20e48f..cd9e1fb9 100644 --- a/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs +++ b/src/test/TestData/Example.Extension/ExampleCompilerExtension.cs @@ -10,10 +10,7 @@ namespace Example.Extension internal class ExampleCompilerExtension : BaseCompilerExtension { - public ExampleCompilerExtension() - { - this.Namespace = "http://www.example.com/scheams/v1/wxs"; - } + public override XNamespace Namespace => "http://www.example.com/scheams/v1/wxs"; public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) { diff --git a/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs b/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs index 870b02e1..16da1316 100644 --- a/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs +++ b/src/test/TestData/Example.Extension/ExampleTableDefinitions.cs @@ -9,7 +9,7 @@ namespace Example.Extension { public static readonly TableDefinition ExampleTable = new TableDefinition( "Example", - new List<ColumnDefinition> + new[] { new ColumnDefinition("Example", ColumnType.String, 72, true, false, ColumnCategory.Identifier), new ColumnDefinition("Value", ColumnType.String, 0, false, false, ColumnCategory.Formatted), -- cgit v1.2.3-55-g6feb