[英]Auto-generate an interface implementation in C#?
I know this is quite lazy but, is there any way on Visual C# 2010 Express to auto-generate an interface implementation? 我知道这很懒,但有没有什么办法在Visual C#2010 Express上自动生成接口实现? (I don't mean at runtime but at design time, like a code snippet).
(我不是说在运行时但是在设计时,就像代码片段一样)。 Perhaps with a third party utility?
也许有第三方实用程序?
I'm not familiar with Express enough to know if they removed this feature, but you should just be able to right-click your public class MyClass : MyInterface
statement and choose "Implement Inteface". 我不熟悉Express足以知道他们是否删除了这个功能,但你应该能够右键单击你的
public class MyClass : MyInterface
语句并选择“Implement public class MyClass : MyInterface
”。
If this is removed in Express, you can always use Resharper for this feature. 如果在Express中将其删除,则可以始终使用Resharper来实现此功能。
Right click on the interface name, you should see a menu option "Implement Interface" or along those lines. 右键单击接口名称,您应该看到菜单选项“实现接口”或沿着这些行。
With the cursor on the interface name, you can also press CTRL + .
将光标放在界面名称上,也可以按
CTRL + .
to get the same context menu and options. 获得相同的上下文菜单和选项。
In Microsoft Visual Basic 2010 Express, I just put the cursor to the end of the Implements line and press Enter - then the stubs are generated automatically 在Microsoft Visual Basic 2010 Express中,我只是将光标放在Implements行的末尾并按Enter键 - 然后自动生成存根
Public Class Class1
Implements IMyInterface1
move the cursor to the end of the word IMyInterface1 and press Enter 将光标移动到单词IMyInterface1的末尾,然后按Enter键
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.