aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/WindowsInstaller/Rows/SummaryInfoRowCollection.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-07 14:17:39 -0800
committerRob Mensching <rob@firegiant.com>2017-12-07 14:17:39 -0800
commit221da62c05ef2b515eb507c77655514cd0ec32a4 (patch)
treefabec5b8ac871f17de6fe0aad3e6188b9af42bfb /src/WixToolset.Data/WindowsInstaller/Rows/SummaryInfoRowCollection.cs
parentca376995792d2e2a1a7f39760989496702a8f603 (diff)
downloadwix-221da62c05ef2b515eb507c77655514cd0ec32a4.tar.gz
wix-221da62c05ef2b515eb507c77655514cd0ec32a4.tar.bz2
wix-221da62c05ef2b515eb507c77655514cd0ec32a4.zip
Reintegrate MSI constructs into WxToolset.Data.WindowsInstaller namespace
Diffstat (limited to 'src/WixToolset.Data/WindowsInstaller/Rows/SummaryInfoRowCollection.cs')
-rw-r--r--src/WixToolset.Data/WindowsInstaller/Rows/SummaryInfoRowCollection.cs41
1 files changed, 41 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..fc0410e9
--- /dev/null
+++ b/src/WixToolset.Data/WindowsInstaller/Rows/SummaryInfoRowCollection.cs
@@ -0,0 +1,41 @@
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
3namespace WixToolset.Data.WindowsInstaller.Rows
4{
5 using System;
6 using System.Collections.ObjectModel;
7
8 /// <summary>
9 /// Indexed container class for summary information rows.
10 /// </summary>
11 public sealed class SummaryInfoRowCollection : KeyedCollection<int, Row>
12 {
13 /// <summary>
14 /// Creates the keyed collection from existing rows in a table.
15 /// </summary>
16 /// <param name="table">The summary information table to index.</param>
17 public SummaryInfoRowCollection(Table table)
18 {
19 if (0 != String.CompareOrdinal("_SummaryInformation", table.Name))
20 {
21 string message = string.Format(WixDataStrings.EXP_UnsupportedTable, table.Name);
22 throw new ArgumentException(message, "table");
23 }
24
25 foreach (Row row in table.Rows)
26 {
27 this.Add(row);
28 }
29 }
30
31 /// <summary>
32 /// Gets the summary property ID for the <paramref name="row"/>.
33 /// </summary>
34 /// <param name="row">The row to index.</param>
35 /// <returns>The summary property ID for the <paramref name="row"/>.
36 protected override int GetKeyForItem(Row row)
37 {
38 return (int)row[0];
39 }
40 }
41}