Refactoring – a new feature in the Visual C# 2.0 IDE
Implementing Interfaces
Assume you have an interface containing say, 30 functions.
You now want to write a class that implements this interface, but don't have the enthusiasm to implement all 30 functions (you just want to implement a couple for them for quick testing). What do you do? You cant just implement the ones you're interested in - the compiler will never let you hear the end of it). Fortunately, the C# 2005 IDE gives you a way out. Here's what you do - declare your class that implements the interface. Then, right click on the interface name, and choose the option "Implement interface", and voila! The stubs are created for you.


You must have seen that there's also an "Implement Interface Explicitly" option. What does that do? Well, that just puts the Interface name in front of the function name or property name which is being implemented - because, there might be situations where a class is implementing two interfaces, and both the interfaces have a function foo(), and in your class, you might want to provide separate implementations for foo() depending on the interface through which it is invoked. In that case, you will need to inform the compiler as to which implementation is for which interface. The image below should make things clearer:

As you can see, the IsUsernameValid() function definitions are now prefixed by the Interface names. (The above code was generated by right clicking on the interface name and choosing "Implement Interface Explicitly".