views:

234

answers:

3

Is there a shortcut of some kind in C# (VS 2008) to automatically implement the virtual and abstract base class methods in a derived class?

+1  A: 

For virtual methods type override, give an space and intellisense will show you all methods that can be inherited.

eKek0
+8  A: 

For virtual methods, you can type override and then a space. Intellisense should offer you a list of options.

For abstract methods and properties, you can use the smart tag on the base class or interface (also, Ctrl+. or Shift+Alt+F10 will show the smart tag menu) to generate the concrete items.

For example, in the following code snippet, you could place the caret at the end of INotifyPropertyChanged and press Ctrl+. to then select Implement Interface, and the PropertyChanged event would be added to MyClass:

class MyClass : INotifyPropertyChanged
{
}
Jeff Yates
+4  A: 
CMS