Как создать собственную коллекцию в .NET 2.0
Здравствуйте, я хочу создать свою собственную коллекцию, я получаю свой собственный класс коллекции из класса CollectionBase, как показано ниже:
public class MyCollection : System.Collectio.CollectionBase
{
MyCollection(){}
public void Add(MyClass item)
{
this.List.Add(item);
}
}
class MyClass
{
public string name;
}
Позвольте мне задать несколько вопросов:
Whether this approach is correct and new, as I working on .NET 3.5 framework. I want to expose this collection from my web service ( WCF) .How can I do that? Do I have to implement GetEnumerator? Whether this will Bind to DataGridView.