问题
It appears that Visual Studio 2012 has removed the automatic implementation of abstract classes that inherit from an interface, any idea how to fix this in 2012 version?
回答1:
It seems to still be possible. Please see this How To article from MSDN
I tested it and it seems to work just fine.
Use this procedure to perform the Implement Abstract Base Class IntelliSense operation. For more information, see Implement Abstract Base Class. To implement an abstract base class using IntelliSense
- Create a console application.
- Place the cursor after the
class Programstatement. - Type
: StringComparerso the class declaration becomesclass Program : StringComparer. - Click the smart tag under
StringComparer, and click Implement abstract class 'System.StringComparer'. IntelliSense adds three override methods from theStringComparerclass to theProgramclass.
I created an interface IModelBase
namespace VendorPrototype.Model
{
interface IModelBase
{
int ID();
DateTime CreatedDate();
String CreatedBy();
DateTime LastModifiedDate();
String LastModifiedBy();
}
}
and a class ModelBase
abstract class ModelBase : IModelBase
{
}
When I clicked IModelBase and hovered under it, I was able to see the menu.
来源:https://stackoverflow.com/questions/19369048/visual-studio-2012-shortcut-to-implement-interface