using System;
using System.Text;
using System.Collections;
namespace DevComponents.DotNetBar.Rendering
{
///
/// Defines collection for Office2007RibbonTabItemColorTable items.
///
public class Office2007RibbonTabItemColorTableCollection : CollectionBase
{
#region Internal Implementation
/// Creates new instance of the class.
public Office2007RibbonTabItemColorTableCollection() { }
///
/// Adds new object to the collection.
///
/// Object to add.
/// Index of newly added object.
public int Add(Office2007RibbonTabItemColorTable colorTable)
{
return List.Add(colorTable);
}
///
/// Returns reference to the object in collection based on it's index.
///
public Office2007RibbonTabItemColorTable this[int index]
{
get {return (Office2007RibbonTabItemColorTable)(List[index]);}
set {List[index] = value;}
}
///
/// Returns reference to the object in collection based on it's index.
///
public Office2007RibbonTabItemColorTable this[string name]
{
get
{
foreach (Office2007RibbonTabItemColorTable ct in this.List)
{
if (ct.Name == name)
return ct;
}
return null;
}
}
///
/// Inserts new object into the collection.
///
/// Position of the object.
/// Object to insert.
public void Insert(int index, Office2007RibbonTabItemColorTable 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(Office2007RibbonTabItemColorTable 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(Office2007RibbonTabItemColorTable value)
{
return List.Contains(value);
}
///
/// Returns whether collection contains object with specified name.
///
/// Name of the object to look for
/// true if object with given name is part of the collection otherwise false
public bool Contains(string name)
{
foreach (Office2007RibbonTabItemColorTable ct in this.List)
{
if (ct.Name == name)
return true;
}
return false;
}
///
/// Removes specified object from the collection.
///
///
public void Remove(Office2007RibbonTabItemColorTable value)
{
List.Remove(value);
}
///
/// Copies collection into the specified array.
///
/// Array to copy collection to.
/// Starting index.
public void CopyTo(Office2007RibbonTabItemColorTable[] array, int index)
{
List.CopyTo(array, index);
}
///
/// Copies contained items to the Office2007ButtonItemColorTable array.
///
/// Array to copy to.
internal void CopyTo(Office2007RibbonTabItemColorTable[] array)
{
List.CopyTo(array,0);
}
protected override void OnClear()
{
base.OnClear();
}
#endregion
}
}