Interfaces

  • Thread starter Thread starter Brett Hewitson
  • Start date Start date
B

Brett Hewitson

I am new to C# and I am trying to implement a class that implements the
System.Collections.IDictionary class.

So far this is what I have.

using System;
namespace Test1
{
public class Preferences: System.Collections.IDictionary
{
private System.Collections.SortedList mPreferences = new
System.Collections.SortedList();
public Preferences()
{
}
}
}


My question is that I need to include the Fields, Methods etc.. from the
System.Collections.IDictionary class. For example:
public void Add(object key, object value)
{
mPreferences.Add(key, value);
}

I am able to do this manually (or typing it in), but can anyone tell me if
there is an easier way using the VS IDE?

In Visual Basic.NET, when the code window is open there are two combo boxes
at the top. By selecting the interface from the left combobox a list of
Properties and Methods are listed in the right combobox. You can then
select the properties and methods and the code is entered into the code
windows automatically.

Thanks for any help.
Brett
 
If you add an interface to a class definition you should
see a tip explaining that you can add all stubs of the
interface by pressing the TAB key.
 
Back
Top