using System;
using System.Collections ;
namespace LiveChain.CSW.CommonData
{
public class ChildData
{
//only property
}
public class ChildDataCollection : System.Collections.CollectionBase,System.ComponentModel.IListSource
{
// string fullName = "LiveChain.CSW.CommonData.ChildData";
public ChildData this[ int index ]
{
get
{
return( (ChildData) List[index] );
}
set
{
List[index] = value;
}
}
public ChildData this[string childId]
{
get
{
foreach (ChildData child in List)
{
if (child.ChildId == childId)
return child ;
}
// if can't find the child ,return null ;
return new ChildData() ;
}
}
public int Add( ChildData value )
{
return( List.Add( value ) );
}
public int IndexOf( ChildData value )
{
return( List.IndexOf( value ) );
}
public void Insert( int index, ChildData value )
{
List.Insert( index, value );
}
public void Remove( ChildData value )
{
List.Remove( value );
}
public bool Contains( ChildData value )
{
// If value is not of type ChildData, this will return false.
return( List.Contains( value ) );
}
#region IListSource 成员
public IList GetList()
{
// TODO: 添加 StudentDataCollection.GetList 实现
return this.List;
}
public bool ContainsListCollection
{
get
{
// TODO: 添加 StudentDataCollection.ContainsListCollection getter 实现
return false;
}
}
#endregion
}