んでもってこうかな?
.NET Framework 開発者ガイド:イベントの発生
を読んでいて、
以前こう書いていたのは、
[Visual Basic]Imports System
Imports System.Collections.Generic
' ジェネリッククラスであることに何の意味も無いけど。
Public Class Folder(Of T)
Private _value As T
Public Property Value() As T
Get
Return _value
End Get
Set(ByVal value As T)
_value = value
' イベントを発生させる。
RaiseEvent ValueUpdated(Me, New EventArgs)
End Set
End Property
Public Event ValueUpdated(ByVal sender As Object, ByVal e As EventArgs)
End Class
[Visual Basic]Imports System
Imports System.Collections.Generic
' ジェネリッククラスであることに何の意味も無いけど。
Public Class Folder(Of T)
Private _value As T
Public Property Value() As T
Get
Return _value
End Get
Set(ByVal value As T)
_value = value
' OnValueUpdated メソッドを呼び出して・・・
Me.OnValueUpdated(New EventArgs)
End Set
End Property
Public Event ValueUpdated(ByVal sender As Object, ByVal e As EventArgs)
Protected Sub OnValueUpdated(ByVal e As EventArgs)
' ここで RaiseEvent!
RaiseEvent ValueUpdated(Me, e)End Sub
End Class
かな?って思ったのでメモる。