From 2bb37beda887d120a0ddabf874ad25357101faa1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 1 Nov 2017 10:59:45 -0700 Subject: Update to WiX Intermediate Representation --- .../Rows/SummaryInfoRowCollection.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs (limited to 'src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs') diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs b/src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs new file mode 100644 index 00000000..bc931f15 --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs @@ -0,0 +1,42 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data.Rows +{ + using System; + using System.Collections; + using System.Collections.ObjectModel; + + /// + /// Indexed container class for summary information rows. + /// + public sealed class SummaryInfoRowCollection : KeyedCollection + { + /// + /// Creates the keyed collection from existing rows in a table. + /// + /// The summary information table to index. + public SummaryInfoRowCollection(Table table) + { + if (0 != String.CompareOrdinal("_SummaryInformation", table.Name)) + { + string message = string.Format(WixDataStrings.EXP_UnsupportedTable, table.Name); + throw new ArgumentException(message, "table"); + } + + foreach (Row row in table.Rows) + { + this.Add(row); + } + } + + /// + /// Gets the summary property ID for the . + /// + /// The row to index. + /// The summary property ID for the . + protected override int GetKeyForItem(Row row) + { + return (int)row[0]; + } + } +} -- cgit v1.2.3-55-g6feb