// Copyright 2003-2004 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Apache.Avalon.Framework
{
using System;
using System.Collections;
///
/// A collection of objects.
///
public class ConfigurationCollection: CollectionBase
{
///
/// Creates a new instance of ConfigurationCollection.
///
public ConfigurationCollection()
{
}
///
/// Creates a new instance of ConfigurationCollection.
///
public ConfigurationCollection(ConfigurationCollection value)
{
this.AddRange(value);
}
///
/// Creates a new instance of ConfigurationCollection.
///
public ConfigurationCollection(IConfiguration[] value)
{
this.AddRange(value);
}
///
/// Represents the entry at the specified index of the .
///
///
/// The zero-based index of the entry to locate in the collection.
///
///
/// The entry at the specified index of the collection.
///
///
/// is outside the valid range of indexes for the collection.
///
public IConfiguration this[int index]
{
get
{
return (IConfiguration) List[index];
}
set
{
List[index] = value;
}
}
///
/// Adds an .
///
/// The to add.
///
/// The index at which the new element was inserted.
///
public int Add(IConfiguration value)
{
return List.Add(value);
}
///
/// Adds an array of .
///
/// The Array of to add.
public void AddRange(IConfiguration[] value)
{
foreach(IConfiguration configuration in value)
{
this.Add(configuration);
}
}
///
/// Adds a .
///
/// The to add.
public void AddRange(ConfigurationCollection value)
{
foreach(IConfiguration configuration in value)
{
this.Add(configuration);
}
}
///
/// Copies the elements to a one-dimensional instance at the specified index.
///
///
/// The one-dimensional must have zero-based indexing.
///
/// The zero-based index in array at which copying begins.
public void CopyTo(IConfiguration[] array, int index)
{
List.CopyTo(array, index);
}
///
/// Gets a value indicating whether the contains
/// in the collection.
///
/// The to locate.
///
/// if the is contained in the collection;
/// otherwise, .
///
public bool Contains(IConfiguration value)
{
return List.Contains(value);
}
///
/// Gets the index of a in
/// the collection.
///
/// The to locate.
///
/// The index of the of in the
/// collection, if found; otherwise, -1.
///
public int IndexOf(IConfiguration value)
{
return List.IndexOf(value);
}
///
/// Inserts a into the collection
/// at the specified index.
///
/// The zero-based index where should be inserted.
/// The to insert.
public void Insert(int index, IConfiguration value)
{
List.Insert(index, value);
}
///
/// Removes a specific from the
/// collection.
///
/// The to remove from the collection.
///
/// is not found in the collection.
///
public void Remove(IConfiguration value)
{
List.Remove(value);
}
}
}