开发者

How can I make a class recognize that an interface found in a separate file exists

I've made an interface called ApprovalEvent in a separate file with 开发者_如何学JAVAthe namespace myproject... I've also made a class called PurchaseOrder... it's also in the same namespace, just in a separate file. Whenever I try to make PurchaseOrder implement ApprovalEvent it always says that ApprovalEvent is undefined...

How can I make the class recognize that the interface exists but is in a different file?

Here's some code:

File #1

Namespace myproject
    Public Interface ApprovalEvent
        Function getDetails() As String
    End Interface
End Namespace

File #2

Namespace myproject
    Partial Class PurchaseOrder 
        Inherits Entities.Modules.PortalModuleBase 
        Implements ApprovalEvent

        Function getDetails() As String Implements ApprovalEvent.getDetails
            return "details"
        End FUnction
    End Class  
End Namespace

Thanks,

Matt


Separate project too? Does the one project include the other as a reference if so? That shouldn't be a problem from what I can see. It works no problem. Try temporarily including the interface in the same file too, see if that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜