I would like to use a strongly typed dictionary consisting of keys and
values of type string. Now there is a specialized StringDictionary,
but I need a sorted StringDictionary to enhance searching for keys.
Now would you recommend me to use a generic SortedDictionary<string,
string> instead of a specialized string dictionary?
What can be done to have a shorter notation of
SortedDictionary<string, string> in case of references, e.g.
StringDictionary<string, string> a = new StringDictionary<string,
string>(StringComparer..InvariantCultureIgnoreCase);
StringDictionary<string, string> b = a;
I found out, that the compiler does not have any problems, if the last
line is replaced by:
IDictionary b = a;
But how does the compiler know, that b consists of strongly typed
string keys and values, if following is implemented:
b.Add("Test", "Test");
Would you recommend me to use StringDictionary<string, string> instead
of IDictionary to add entries due to performance reasons?
Regards,
Norbert
Sorry I meant SortedDictionary<string, string> a ...