strong type dictionary

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

If I want to construct a dictionary with a string key of max length of 16,
value of a list, an object or struct, say mystuff. mystuff consists of 2
properties:
sequence as integer
string value with max length of 2048
how would I go about it?

I expect only about 50 to 80 entries in the dictionary
 
GS said:
If I want to construct a dictionary with a string key of max length of 16,
value of a list, an object or struct, say mystuff. mystuff consists of 2
properties:
sequence as integer
string value with max length of 2048
how would I go about it?

I expect only about 50 to 80 entries in the dictionary


'System.Collections.Generic.Dictionary(Of TKey, TValue)'.
 
GS said:
If I want to construct a dictionary with a string key of max length of 16,
value of a list, an object or struct, say mystuff. mystuff consists of 2
properties:
sequence as integer
string value with max length of 2048
how would I go about it?

Create a class inherited from DictionaryBase or CollectionBase.

This gives you the ability to intercept values as they are coming in (so
you can check key lengths, etc.), and to add strongly typed Add and Item
methods/properties, but handles the data storage for you.

HTH,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top