// 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.Link
{
using System;
using System.Collections;
///
/// Hash collection of connect to feature objects.
///
public sealed class ConnectToFeatureCollection : ICollection
{
private Hashtable collection;
///
/// Instantiate a new ConnectToFeatureCollection class.
///
public ConnectToFeatureCollection()
{
this.collection = new Hashtable();
}
///
/// Gets the number of items in the collection.
///
/// Number of items in collection.
public int Count
{
get { return this.collection.Count; }
}
///
/// Gets if the collection has been synchronized.
///
/// True if the collection has been synchronized.
public bool IsSynchronized
{
get { return this.collection.IsSynchronized; }
}
///
/// Gets the object used to synchronize the collection.
///
/// Oject used the synchronize the collection.
public object SyncRoot
{
get { return this.collection.SyncRoot; }
}
///
/// Gets a feature connection by child id.
///
/// Identifier of child to locate.
public ConnectToFeature this[string childId]
{
get { return (ConnectToFeature)this.collection[childId]; }
}
///
/// Adds a feature connection to the collection.
///
/// Feature connection to add.
public void Add(ConnectToFeature connection)
{
if (null == connection)
{
throw new ArgumentNullException("connection");
}
this.collection.Add(connection.ChildId, connection);
}
///
/// Copies the collection into an array.
///
/// Array to copy the collection into.
/// Index to start copying from.
public void CopyTo(System.Array array, int index)
{
this.collection.CopyTo(array, index);
}
///
/// Gets enumerator for the collection.
///
/// Enumerator for the collection.
public IEnumerator GetEnumerator()
{
return this.collection.Values.GetEnumerator();
}
}
}