How can I get a KeyedCollection to be read-only?
问题 First let me explain why I'm using a KeyedCollection. I'm building a DLL and I have a list of items that I need to add to a collection and have them stay in the order I placed them but I also need to access them by both their index and by key (the key is a property of an object which I already defined). If there is any other simpler collection that does this, then please let me know. Ok now, I need to be able to add items to this collection internally in the DLL but I need it to be publicly