Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Implemented interface methods are not available and do not show in Intellisense?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 26 Mar 2006 00:01 GMT
I'm creating my own SortedList collection class that implements IDictionary,
ICollection, and IEnumerable.  The code compiles.

I am writing a unit test to exercise it.  I can create the object but none
of the methods like Add are available.  The only thing that shows in
Intellisense is:

Equals
GetHashCode
GetType
ToString

What am I doing wrong??
Jon Skeet [C# MVP] - 26 Mar 2006 08:28 GMT
> I'm creating my own SortedList collection class that implements IDictionary,
> ICollection, and IEnumerable.  The code compiles.
[quoted text clipped - 9 lines]
>
> What am I doing wrong??

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

If you've implemented the interface explicitly (i.e. your methods look
like void IDictionary.Add (...) etc) then you'll need to cast the
subject of your test to the interfaces before calling the method:

IDictionary dict = sortedList;
dict.Clear (...)

Signature

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

n4ixt - 27 Mar 2006 13:29 GMT
Might help if you posted some code so we could see.

> I'm creating my own SortedList collection class that implements
> IDictionary, ICollection, and IEnumerable.  The code compiles.
[quoted text clipped - 9 lines]
>
> What am I doing wrong??

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.