.net 部分类和接口

.net 部分类和接口,.net,inheritance,partial-classes,.net,Inheritance,Partial Classes,假设我有以下设置: Public Interface IA Property Name() Property Id() ... End Interface //Custom File Partial Public Class A ... Mostly Blank - used for extending the generated file End Class //Generated via a tool Partial Public Class A ... contains

假设我有以下设置:

Public Interface IA
    Property Name()
    Property Id()
...
End Interface

//Custom File
Partial Public Class A
... Mostly Blank - used for extending the generated file
End Class

//Generated via a tool
Partial Public Class A
... contains properties, methods, etc
    Property Name() ..
    Property Id() ..
End Class
我已经将接口添加到自定义文件中,但是VS向我抛出了一个错误,因为属性是在生成的文件中实现的。还有别的解决办法吗?我希望避免接触生成的分部类

谢谢,
~P

生成的文件需要使用Implements关键字。在VB.NET语言中的硬要求,没有解决方法。这与部分类无关。

哪个类实现了接口?你的问题不清楚..自定义文件(没有实际实现属性的文件)C#是否有相同的限制?