// 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.WindowsInstaller.Rows
{
using System;
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];
}
}
}