2011-01-19 13 views
1

発行:一部IBindableComponentインターフェイスの実装では、私は、次のコードにIBindableComponentを実装する必要が

Public Class InfragisticsToolStripBindableButton 
    Inherits Infragistics.Win.UltraWinToolbars.ButtonTool 
    Implements IBindableComponent 

    Private _DataBindings As ControlBindingsCollection 
    Private _BindingContext As BindingContext 

    Public Event Disposed As EventHandler Implements IBindableComponent.Disposed 

    Sub New() 
    MyBase.New(String.Empty) 
    End Sub 

    Public ReadOnly Property DataBindings() As ControlBindingsCollection 
    Get 
     If _DataBindings Is Nothing Then 
     _DataBindings = New ControlBindingsCollection(Me) 
     End If 
     Return _DataBindings 
    End Get 
    End Property 

    Public Property BindingContext() As BindingContext 
    Get 
     If _BindingContext Is Nothing Then 
     _BindingContext = New BindingContext() 
     End If 
     Return _BindingContext 
    End Get 
    Set(ByVal value As BindingContext) 
     _BindingContext = value 
    End Set 
    End Property 

    Public Overloads Sub Dispose() 
    '???????? include bellow code ' 
    RaiseEvent Disposed(Me, EventArgs.Empty) 
    End Sub 

    'Protected Overrides Sub Dispose(ByVal disposing As Boolean) 
    ' If disposing Then 
    ' If _DataBindings IsNot Nothing Then 
    '  _DataBindings.Clear() 
    '  _DataBindings = Nothing 
    ' End If 
    ' _BindingContext = Nothing 
    ' End If 
    ' MyBase.Dispose(disposing) 
    'End Sub 
End Class 

1問題:
警告:基本クラスのプロパティ「配置されているの」とイベント "配置されているの葛藤'DisposableObject' と '影'

2問題に宣言する必要があります。
エラー: クラスのInfrag isticsToolStripBindableButton 'は、' System.ComponentModel.IComponent 'インターフェースの' Property Site As Isite 'を実装する必要があります。プロパティの実装には、 'ReadOnly'または 'WriteOnly'指定子が一致している必要があります。

"IBindableComponent"を実装すると、なぜ "IComponent"を実装する必要がありますか?

3問題:
がすでに基底クラスで実装が、どうやら仮想でないならどのように私は、「廃棄」オーバーライドする必要があります。

答えて

3

Disposedという名前を付けることはできますが、名前はインターフェイスと同じである必要はありません。

Public Event StripDisposed As EventHandler Implements IBindableComponent.Disposed 

IBindableComponent.Disposedの仕組みを参照してください。

+0

ありがとうございます。ちょっとしたコードを追加しました。 : ") – serhio

関連する問題