Home All Groups Group Topic Archive Search About

readonly access to generic collections.

Author
18 May 2006 8:30 AM
Strider
Is there a way to have a read - only generic List, Dictionar etc in .NET
Framework 2.0 (something like the ArrayList.Readonly() method), or do I have
to make a wrapper myself?

Author
18 May 2006 9:02 AM
Robin Theilade
Try

List<T>.AsReadOnly()

Best regards,
Robin Theilade

Show quote
"Strider" <Stri***@discussions.microsoft.com> wrote in message
news:FAF251C7-EA3E-4A1E-AADD-831FD040D998@microsoft.com...
> Is there a way to have a read - only generic List, Dictionar etc in .NET
> Framework 2.0 (something like the ArrayList.Readonly() method), or do I
> have
> to make a wrapper myself?
Author
18 May 2006 11:04 AM
Strider
Thanks Robin, this is just what I was looking for!


Show quote
"Robin Theilade" wrote:

> Try
>
> List<T>.AsReadOnly()
>
> Best regards,
> Robin Theilade
>
> "Strider" <Stri***@discussions.microsoft.com> wrote in message
> news:FAF251C7-EA3E-4A1E-AADD-831FD040D998@microsoft.com...
> > Is there a way to have a read - only generic List, Dictionar etc in .NET
> > Framework 2.0 (something like the ArrayList.Readonly() method), or do I
> > have
> > to make a wrapper myself?
>
>
>

AddThis Social Bookmark Button