Shaykat, another PM on the C# team, recently posted (http://blogs.msdn.com/shaykatc/archive/2004/03/10/87582.aspx) a VS 2003 tip for automatically implementing an interface. We have received almost universally positive feedback about it, but there were definitely some gotchas:
We have attempted to tackle all of these issues in Whidbey. In order to invoke this feature in Whidbey you'll use an editor 'smart tag'. This tag is a little marker that appears underneath an interface name when the cursor is on the same line in which it appears. It can be invoked through the keyboard or by hovering the mouse over the marker. After invocation a context like menu will appear, which in this case, will offer two options. To either implement the interface implicitly, or explicitly.
You've probably already determined how this addressees the first two issues. First, the smart tag is always available, so if you add additional members to an interface then it's easy to invoke the feature again and generate the additional stubs. Second, we no longer attempt to determine whether to implement the interface explicitly or implicitly, instead we leave that decision in the hands of the developer (where it belongs).
The code generation bullets are interesting, because there are a lot of features in Whidbey that generate code in some manner. Given that, we decided to leverage our expansions feature (I'll blog about this separately if you haven't read about it elsewhere yet) to allow developers to modify the generated code. For example, the implement interface feature uses an expansion that looks like this:
The $signature$ literal is replaced when the code is generated. To put a comment in every generated method stub, you would just add it to this file. The $NotImplementedException$ literal is worth mentioning as well. Its replacement value is determined by a function. In this case, the function “SimpleTypeName” is used, which determines what the 'simplest' form of global::System.NotImplementedException is. That is, if you were to implement an interface in a context with no using directives, it would insert System.NotImplementedException; however, if you were to implement the same interface in a scope in which the System namespace had been imported then it would use 'throw NotImplementedException()'.