I'm working on a C# object copy constructor, part of which involves copying the contents of a KeyedCollection into a new KeyedCollection. This is what I have implemented currently:
class MyKeyedCollection : KeyedCollection<uint, DataObject>
{
protected override uint GetKeyForItem( DataObject do )
{
return do.Key;
}
}...
Hi everybody,
I want to implement a keyed observable collection in Silverlight, that will store unique objects based on a property called Name. One way of doing it is to use the ObservableCollectionEx (samples in another stackoverflow post) class which subscribes to all PropertyChanged events on the contained elemens and check to see if...
I want to use a KeyedCollection to store a class against a string key value. I have the following code:
public class MyClass
{
public string Key;
public string Test;
}
public class MyCollection : KeyedCollection<string, MyClass>
{
public MyCollection() : base()
{
}
protected override String GetKeyForItem(MyCla...
I have this class declaration:
Public Class clsColection(Of T)
Inherits System.Collections.ObjectModel.KeyedCollection(Of String, T)
Implements System.Collections.IEnumerable
Implements System.Collections.Generic.IEnumerable(Of T)
...
Public Shadows Function GetEnumerator() As System.Collections.Generic.IEnumerator(Of T...