Method Exposure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a collections class that inherits from CollectionsBase. I've implemented "Add" but I would like that to be the only method exposed...I don't want "RemoveAt" or any of those others in CollectionsBase exposed. Is there a way to do that

Thanks
 
Sure. Don't inherit System.Collections.CollectionBase. Implement IEnumerable
and create your own CollectionBase.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Dave said:
I have a collections class that inherits from CollectionsBase. I've
implemented "Add" but I would like that to be the only method exposed...I
don't want "RemoveAt" or any of those others in CollectionsBase exposed. Is
there a way to do that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top