Hello,

Need urgent help. Hope for good solution.

I have two classes inherited from System.Collections.CollectionBase.


Code:
public class1: System.Collections.CollectionBase
{ //.. }

public class2: System.Collections.CollectionBase
{ 

    private class1 obj = new class1();

    public class1 MyReadOnlySubClass 
    {
           get { return class1; }
    } 

     //.. 
}
So I return class1 as property in class2. How to hide returned class'es methods such Add, Clear, Insert, RemoveAt? I only need ability to enumerate this class with foreach and get all child objects.


Regards in advance,
Andrius