So did the .NET 2.0 working group just run out of steam before it got to a
ReadOnlyDictionary<> wrapper?
I am publishing events containing a SortedList<>, and obviously I don't want
event handlers to be able to do anything to the collection at the same time
other recipients could be handling it.
I found a ReadOnlyCollection<> wrapper, which I can apply to the .Keys and
..Values of the SortedList, but I can't find any way to wrap the SortedList
itself. I need to preserve SortedList functionality, but I would prefer to
have a programmatic way of ensuring recipients don't manhandle the shared
SortedList.
Is there any other solution to that short of writing my own
ReadOnlyDictionary, or cloning the collection for every recipient (which is
prohibitively expensive for me)?