473,383 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

StringDictionary does not implement either ICollection or IDictionary?

Sorry, forgot to cross post this one..

This is rather unusual as we would expect any Collection class to implement
ICollection interface and furthermore a Dictionary class should implement
IDictionary interface. The StringDictionary class does implements all the
methods of ICollection and IDictionary yet it does not list these
interfaces. Am I missing something here or was it an oversight on the part
of the class developer. Maybe I have attained the .NET nirvana yet?

Sanjay Vyas
Nov 15 '05 #1
4 3681
Sanjay,

This is rather odd. It should implement IDictionary, at least (I don't
think it should implement ICollection, because nothing is really indexed by
number here, and you can't guarantee the order). I'll submit it as a bug,
but the new generic classes should rectify this (as the generic will
implement the appropriate interfaces).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sanjay Vyas" <sanjayvyas@_hotmail.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
Sorry, forgot to cross post this one..

This is rather unusual as we would expect any Collection class to implement ICollection interface and furthermore a Dictionary class should implement
IDictionary interface. The StringDictionary class does implements all the
methods of ICollection and IDictionary yet it does not list these
interfaces. Am I missing something here or was it an oversight on the part
of the class developer. Maybe I have attained the .NET nirvana yet?

Sanjay Vyas

Nov 15 '05 #2
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
This is rather odd. It should implement IDictionary, at least (I don't
think it should implement ICollection, because nothing is really indexed by
number here, and you can't guarantee the order).


I think you're getting confused with IList (like I did this morning).
IDictionary itself actually implements/extends ICollection - any
IDictionary is also an ICollection.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Very true.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
This is rather odd. It should implement IDictionary, at least (I don't think it should implement ICollection, because nothing is really indexed by number here, and you can't guarantee the order).


I think you're getting confused with IList (like I did this morning).
IDictionary itself actually implements/extends ICollection - any
IDictionary is also an ICollection.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #4
It must be a bug as an article on MSDN actually
mentions"....StringDictionary (based on IDictionary)...."
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
This is rather odd. It should implement IDictionary, at least (I don't think it should implement ICollection, because nothing is really indexed by number here, and you can't guarantee the order).


I think you're getting confused with IList (like I did this morning).
IDictionary itself actually implements/extends ICollection - any
IDictionary is also an ICollection.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: J.R | last post by:
I'm getting an error when I attempt to serialize a type StringDictionary, error suggests type not marked for Serialization, could someone tell me how to go about this? Thanks.
6
by: John | last post by:
Hi! I have a StringDictionary itialized as follows: private void frmICUCalculations_Activated(object sender, System.EventArgs e) { StringDictionary dataDict = new StringDictionary();...
2
by: Wamiq Ansari | last post by:
Hi!, I am trying to add a value to a StringDictionary using its Item Property in C#. However this throws an expection as follows: Cannot implicitly convert type 'Component.TemplateComponent' to...
0
by: hykim | last post by:
public __gc class PropertyCollection : public IDictionary, public ICollection, public IEnumerable { ... private: __property void IDictionary::set_Item(Object *oKey, Object *oValue);...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
0
by: Simon Dahlbacka | last post by:
I was trying to use the built in settings management and added a User-scoped setting of type System.Collections.Specialized.StringDictionary I run my application, updated the Settings, did...
0
by: Hans | last post by:
Hello, I was trying to use the built in settings management and added a User-scoped setting of type System.Collections.Specialized.StringDictionary I run my application, updated the...
0
by: dan | last post by:
Hi, I've been using a GridView for some time but this is the first time I need to delete a row in the grid whose primary key consists of 2 fields (table columns). I have a table with primary...
5
by: Tony Johansson | last post by:
Hello! The only reason I can see interface to be implemented explicitly is when the a class implement two interface having the same method signature. In all other cases I can implement interface...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.