vb.net - 接口(interface)实现它自己的方法

标签 vb.net interface

我们最近在我们的解决方案中遇到了一个与此类似的界面。当我们升级到 VS 2015 时,它导致了构建问题。我们相信删除代码是安全的,但要确保没有其他人能想到为什么这是有效代码或不安全的代码来更改(我们会删除所有这些的工具)?

Public Interface IMyInterface
    Property p1 as string Implements IMyInterface.p1
    Property p2 as string Implements IMyInterface.p2
    Property p3 as string Implements IMyInterface.p3
    Property p4 as string Implements IMyInterface.p4
    .
    .
    .
End Interface

只是不确定接口(interface)方法为什么或如何在其自身上实现属性。

最佳答案

The Visual Basic reserved word Implements is used in two ways. The Implements statement signifies that a class or structure implements an interface. The Implements keyword signifies that a class member or structure member implements a specific interface member.

您应该删除属性声明的 Implements IMyInterface.p_ 部分。

关于vb.net - 接口(interface)实现它自己的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32074554/

相关文章:

c# - 如何对 ToolStripItem 集合中的项目进行排序?

java - 同时扩展 HashMap 和 LinkedHashMap?

java - 谁在 Java 中实现操作系统接口(interface)?

vb.net - Exchange Web 服务 API : Error Sending Message with Attachment

java - 无界Java通用接口(interface)的问题

C# 4.0 动态对象和 WinAPI 接口(interface),如 IShellItem(无需在 C# 源代码中定义它们)

interface - 是否可以在接口(interface)定义中使用 getter/setter?

c# - 你将如何在 VB.net 中编写这个?我没有得到索引++

vb.net - 动态加载的用户控件加载 DropDownList 项目一旦在回发时消失

asp.net - 奇怪的 ASP.Net 错误 : .net 4.6.1,VS2015 - 不支持内插字符串?