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 Answer
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 Program
statement. - Type
: StringComparer
so 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 theStringComparer
class to theProgram
class.
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.
-
2
-
1I believe the default keyboard shortcut to expand the smart tag is ShIFT+ALT+F10. You can customize the keyboard to map it to a different shortcut. I use CTRL+ALT+<.> (Strangely, I tried mapping it to CTRL+<.>, but it didn't work.) -- (Where <.> is the period character).– kmoteJan 13, 2017 at 21:14