2011-12-09 11 views
0

今はインタフェースで非常に奇妙な問題が発生しています。インタフェース 'IName'に一致するプロパティが存在しないため、 'Property'は 'Property'を実装できません

私は非常に簡単な設定をしています。

私のクラスの1つで、私はPropertyInterfaceから実装しています。

私のクラスでは、それは次のようだ:

Private _oForm As IForm 
Public Property Form As IForm Implements IContainer.Form 
    Set(value As IForm) 
     Me._oForm = value 
    End Set 
    Get 
     Return Me._oForm 
    End Get 
End Property 

ここにいるIContainerインタフェースです:

Public Interface IContainer 

    Property Form As IForm 

    Sub OpenScreen(p_oDataKey As DataKey, Optional ByVal p_oOpenScreenProperties As OpenScreenProperties = Nothing) 

End Interface 

それは非常に簡単だそうではありませんか?複雑な実装は一切ありません。私はそれをうまくやっているようです。今、私のIForm内の何もない

そして、それのために、:

Public Interface IForm 

End Interface 

私は常に取得:

Error 2 Class 'BaseContainer' must implement 'Property Form As IForm' for interface 'Common.IContainer'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers. 

Error 3 'Form' cannot implement 'Form' because there is no matching property on interface 'Common.IContainer'. 

私は数十のように持っていますこのようなインターフェイスは私のプロジェクト全体で働いていて、私はこの単純なものがうまくいかないとは信じられません!私に手を差し伸べてください:P

ありがとう!

+1

"BaseContainer"という名前のクラスを表示するようにコードスニペットを更新します。 –

答えて

0

別のインスタンスがicontainer.formを実装しているか、またはiform.formがクラスの他の場所に追加されていないことを確認してください。

たとえば、IContainerを実装すると、VBは実装者をクラスに追加するのに役立ちます。後でインターフェイスを変更すると、余分な参照がある可能性があります。

関連する問題