T
TheNedMan
Sorry for the repost, but I want to get to the bottom of this...
From the Microsoft sample "How-To Create an Offline Application":
Public Delegate Sub CustomersRowChangeEventHandler(ByVal sender As
Object, ByVal e As CustomersRowChangeEvent)
Public Event CustomersRowChanged As CustomersRowChangeEventHandler
Protected Overrides Sub OnRowChanged(ByVal e As
DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.CustomersRowChangedEvent) Is Nothing) Then
RaiseEvent CustomersRowChanged(Me, New
CustomersRowChangeEvent(CType(e.Row,CustomersRow), e.Action))
End If
End Sub
*However* CustomersRowChangedEvent is not defined anywhere - the IDE
can't navigate to its definition - when hovering over
it, the IDE just says it's:
Private Dim CustomersRowChangedEvent As
HowTo.CustomersDataSet.CustomersRowChangeEventHandler
This is driving me insane - in an answer to my previous post Herfried
K. Wagner says that a hidden delegate is created, but that is not
happening here since the CustomersRowChangeEventHandler delegate is
explicitly created. So why the need for the hidden variable
CustomersRowChangedEvent?
To clear this up, I looked up the C# version of "How-To Create an
Offline Application" - it just omitted the "Event" part and used the
actual variable, which I would have thought was the obvious way of
doing this.
Why the nonsense code in VB, when it apparently can be done without
referring to a mysterious hidden variable??
From the Microsoft sample "How-To Create an Offline Application":
Public Delegate Sub CustomersRowChangeEventHandler(ByVal sender As
Object, ByVal e As CustomersRowChangeEvent)
Public Event CustomersRowChanged As CustomersRowChangeEventHandler
Protected Overrides Sub OnRowChanged(ByVal e As
DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.CustomersRowChangedEvent) Is Nothing) Then
RaiseEvent CustomersRowChanged(Me, New
CustomersRowChangeEvent(CType(e.Row,CustomersRow), e.Action))
End If
End Sub
*However* CustomersRowChangedEvent is not defined anywhere - the IDE
can't navigate to its definition - when hovering over
it, the IDE just says it's:
Private Dim CustomersRowChangedEvent As
HowTo.CustomersDataSet.CustomersRowChangeEventHandler
This is driving me insane - in an answer to my previous post Herfried
K. Wagner says that a hidden delegate is created, but that is not
happening here since the CustomersRowChangeEventHandler delegate is
explicitly created. So why the need for the hidden variable
CustomersRowChangedEvent?
To clear this up, I looked up the C# version of "How-To Create an
Offline Application" - it just omitted the "Event" part and used the
actual variable, which I would have thought was the obvious way of
doing this.
Why the nonsense code in VB, when it apparently can be done without
referring to a mysterious hidden variable??