Questions tagged [keyedcollection]
23 questions
0
votes
2 answers
KeyedCollection GetKeyForItem and Dictionary not working
Here is my issue: It doesn't seem like I can use the .Dictionary property or the GetKeyForItem method. Is there a using statement that I'm missing or something? Essentially, I'd like to retrieve a list of keys for each object in my keyedcollection.…

Tim
- 478
- 4
- 15
0
votes
1 answer
KeyedCollection with MutableKey
I started from this article to obtain MutableKey collections for different types.
I want to have an abstract KeyedCollection base class for all my collections, so I used generics and an interface for my purpose but I'm wondering if there is a more…

ilCosmico
- 1,319
- 15
- 26
0
votes
0 answers
Dictionary for enum bitmask
I am either looking for an existing solution or to create a solution to solve a problem for looking up items based on an Enum bitmask. Essentially, I have an Enum with the flag property set and so I can combine these values into a bitmask. What I…

Wadiv
- 1
- 1
0
votes
1 answer
Big O Runtime of Exceptions
I have a custom Dictionary that has a backing collection of KeyedCollection. While trying to optimize performance issues that I'm seeing while running in a profiler, I noticed that the IndexOf(T key) is one of my problem areas. The code is…

Middas
- 1,862
- 1
- 29
- 44
0
votes
2 answers
Keyed ObservableCollection in Silverlight
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…

NotADba
- 117
- 7
-1
votes
1 answer
Country calling code uniquely keyed by code array in Japanese, ruby, yml, php
Asking this question to answer it myself as it's a useful resource for others.
I got this by filtering out the information on the Japanese country codes wiki…

Samuel Frost
- 35
- 9
-1
votes
2 answers
KeyedCollection Error
I'm fairly new to C# collectons. I do not know how to solve this issue.
This line of code
public class clsFeatureCollection : KeyedCollection
Gives the error
'clsFeatureCollection' does not implement inherited abstract member…

Deke
- 117
- 1
- 1
- 8
-2
votes
2 answers
Want some help understanding this method
class SetMap : KeyedCollection
{
public HashSet Use(IEnumerable sourceData)
{
var set = new HashSet(sourceData);
if (Contains(typeof(T)))
{
Remove(typeof(T));
}
Add(set);
return…

Abbas
- 13
- 3