NanoByte.Common
2.6.1
|
A keyed collection (pseudo-dictionary) of INamed objects. Case-insensitive! More...
Public Member Functions | |
NamedCollection () | |
Creates a new named collection. More... | |
NamedCollection (IEnumerable< T > elements) | |
Creates a new named collection pre-filled with elements. More... | |
void | Rename (T element, [Localizable(false)] string newName) |
Renames an element in the list. Renaming an element in the list directly (without using this method) will prevent lookups from working properly! More... | |
virtual NamedCollection< T > | Clone () |
Creates a shallow copy of this collection (elements are not cloned). More... | |
Protected Member Functions | |
override string | GetKeyForItem (T item) |
override void | InsertItem (int index, T item) |
override void | SetItem (int index, T item) |
override void | RemoveItem (int index) |
override void | ClearItems () |
Events | |
Action< object >? | CollectionChanged |
A keyed collection (pseudo-dictionary) of INamed objects. Case-insensitive!
Elements are automatically maintained in an alphabetically sorted order. Suitable for XML serialization.
T | : | INamed |
|
inline |
Creates a new named collection.
|
inline |
Creates a new named collection pre-filled with elements.
elements | The elements to pre-fill the collection with. Must all have unique INamed.Names! |
|
virtual |
Creates a shallow copy of this collection (elements are not cloned).
|
inline |
Renames an element in the list. Renaming an element in the list directly (without using this method) will prevent lookups from working properly!
element | The element to rename. |
newName | The new INamed.Name for the element. |
KeyNotFoundException | The element is not in the collection. |
InvalidOperationException | The newName is already taken by another element in the collection. |