Hi All,
I have a WCF service that needs to expose a custom collection to it's clients. I wondered what would be the best way to expose this object to my clients?
Object Code:
public class ListBoxDataCollection : System.Collections.CollectionBase
{
public ListBoxDataCollection()
{
}
public ListBoxData this[int index]
{
get { return (ListBoxData)this.List[index]; }
set { this.List[index] = value; }
}
public int IndexOf( ListBoxData item )
{
return base.List.IndexOf(item);
}
public int Add( ListBoxData item )
{
return this.List.Add(item);
}
public void Remove( ListBoxData item )
{
this.InnerList.Remove(item);
}
public void CopyTo( Array array, int index )
{
this.List.CopyTo(array, index);
}
public void AddRange( ListBoxDataCollection collection )
{
for (int i = 0; i < collection.Count; i++)
{
this.List.Add(collection[i]);
}
}
public void AddRange( ListBoxData[] data )
{
this.AddRange(data);
}
public bool Contains( ListBoxData item )
{
return this.List.Contains(item);
}
public void Insert( int index, ListBoxData item )
{
this.List.Insert(index, item);
}
}