using System;
using System.Text;
using System.Collections;
namespace DevComponents.DotNetBar.Presentation
{
internal class ShapeCollection : CollectionBase
{
#region Internal Implementation
/// Creates new instance of the class.
public ShapeCollection()
{
}
///
/// Adds new object to the collection.
///
/// Object to add.
/// Index of newly added object.
public int Add(Shape shape)
{
return List.Add(shape);
}
///
/// Returns reference to the object in collection based on it's index.
///
public Shape this[int index]
{
get {return (Shape)(List[index]);}
set {List[index] = value;}
}
///
/// Inserts new object into the collection.
///
/// Position of the object.
/// Object to insert.
public void Insert(int index, Shape value)
{
List.Insert(index, value);
}
///
/// Returns index of the object inside of the collection.
///
/// Reference to the object.
/// Index of the object.
public int IndexOf(Shape value)
{
return List.IndexOf(value);
}
///
/// Returns whether collection contains specified object.
///
/// Object to look for.
/// true if object is part of the collection, otherwise false.
public bool Contains(Shape value)
{
return List.Contains(value);
}
///
/// Removes specified object from the collection.
///
///
public void Remove(Shape value)
{
List.Remove(value);
}
//protected override void OnRemoveComplete(int index,object value)
//{
// base.OnRemoveComplete(index,value);
// Shape me=value as Shape;
//}
//protected override void OnInsertComplete(int index,object value)
//{
// base.OnInsertComplete(index,value);
// Shape me=value as Shape;
//}
///
/// Copies collection into the specified array.
///
/// Array to copy collection to.
/// Starting index.
public void CopyTo(Shape[] array, int index)
{
List.CopyTo(array, index);
}
///
/// Copies contained items to the Shape array.
///
/// Array to copy to.
internal void CopyTo(Shape[] array)
{
List.CopyTo(array,0);
}
#endregion
}
}