diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:59:45 -0700 |
| commit | 2bb37beda887d120a0ddabf874ad25357101faa1 (patch) | |
| tree | c35e97b03274b86cfc9ff7fd2caeee211165a140 /src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs | |
| parent | df7413aeed3aea3425dff20ae0c8b1be3a3ab525 (diff) | |
| download | wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.gz wix-2bb37beda887d120a0ddabf874ad25357101faa1.tar.bz2 wix-2bb37beda887d120a0ddabf874ad25357101faa1.zip | |
Update to WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs')
| -rw-r--r-- | src/WixToolset.Data.WindowsInstaller/Rows/SummaryInfoRowCollection.cs | 42 |
1 files changed, 42 insertions, 0 deletions
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 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data.Rows | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections; | ||
| 7 | using System.Collections.ObjectModel; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// Indexed container class for summary information rows. | ||
| 11 | /// </summary> | ||
| 12 | public sealed class SummaryInfoRowCollection : KeyedCollection<int, Row> | ||
| 13 | { | ||
| 14 | /// <summary> | ||
| 15 | /// Creates the keyed collection from existing rows in a table. | ||
| 16 | /// </summary> | ||
| 17 | /// <param name="table">The summary information table to index.</param> | ||
| 18 | public SummaryInfoRowCollection(Table table) | ||
| 19 | { | ||
| 20 | if (0 != String.CompareOrdinal("_SummaryInformation", table.Name)) | ||
| 21 | { | ||
| 22 | string message = string.Format(WixDataStrings.EXP_UnsupportedTable, table.Name); | ||
| 23 | throw new ArgumentException(message, "table"); | ||
| 24 | } | ||
| 25 | |||
| 26 | foreach (Row row in table.Rows) | ||
| 27 | { | ||
| 28 | this.Add(row); | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | /// <summary> | ||
| 33 | /// Gets the summary property ID for the <paramref name="row"/>. | ||
| 34 | /// </summary> | ||
| 35 | /// <param name="row">The row to index.</param> | ||
| 36 | /// <returns>The summary property ID for the <paramref name="row"/>. | ||
| 37 | protected override int GetKeyForItem(Row row) | ||
| 38 | { | ||
| 39 | return (int)row[0]; | ||
| 40 | } | ||
| 41 | } | ||
| 42 | } | ||
