From 58791d3dbffce2a96280e08fc2d36ab69571d02c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Jun 2020 10:18:50 -0700 Subject: Add SequenceTable.WindowsInstallerTableName() and other minor clean up --- src/WixToolset.Data/WindowsInstaller/Table.cs | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/WixToolset.Data/WindowsInstaller/Table.cs') diff --git a/src/WixToolset.Data/WindowsInstaller/Table.cs b/src/WixToolset.Data/WindowsInstaller/Table.cs index ca6fe3ba..714be20f 100644 --- a/src/WixToolset.Data/WindowsInstaller/Table.cs +++ b/src/WixToolset.Data/WindowsInstaller/Table.cs @@ -59,6 +59,27 @@ namespace WixToolset.Data.WindowsInstaller return row; } + /// + /// Validates the rows of this OutputTable and throws if it collides on + /// primary keys. + /// + public void ValidateRows() + { + var primaryKeys = new Dictionary(); + + foreach (var row in this.Rows) + { + var primaryKey = row.GetPrimaryKey(); + + if (primaryKeys.TryGetValue(primaryKey, out var collisionSourceLineNumber)) + { + throw new WixException(ErrorMessages.DuplicatePrimaryKey(collisionSourceLineNumber, primaryKey, this.Definition.Name)); + } + + primaryKeys.Add(primaryKey, row.SourceLineNumbers); + } + } + /// /// Parse a table from the xml. /// @@ -165,26 +186,5 @@ namespace WixToolset.Data.WindowsInstaller writer.WriteEndElement(); } - - /// - /// Validates the rows of this OutputTable and throws if it collides on - /// primary keys. - /// - public void ValidateRows() - { - var primaryKeys = new Dictionary(); - - foreach (var row in this.Rows) - { - var primaryKey = row.GetPrimaryKey(); - - if (primaryKeys.TryGetValue(primaryKey, out var collisionSourceLineNumber)) - { - throw new WixException(ErrorMessages.DuplicatePrimaryKey(collisionSourceLineNumber, primaryKey, this.Definition.Name)); - } - - primaryKeys.Add(primaryKey, row.SourceLineNumbers); - } - } } } -- cgit v1.2.3-55-g6feb