P
Pieter
Hi,
How can I know inside a given method, by which method it was called?
For instance: I have two property's (Prenom and Nom), both call the Method
PropertyChangedHandler(). How Can I know if PropertyChangedHandle was called
by the Prenom or by Nom?
Public Event PrenomChanged As EventHandler
Public Property Prenom() As String
Get
Return m_strPrenom
End Get
Set(ByVal Value As String)
m_strPrenom = Value
RaiseEvent PrenomChanged(Me, New EventArgs())
PropertyChangedHandler()
End Set
End Property
Public Event NomChanged As EventHandler
Public Property Nom() As String
Get
Return m_strNom
End Get
Set(ByVal Value As String)
m_strNom = Value
RaiseEvent NomChanged(Me, New EventArgs())
PropertyChangedHandler()
End Set
End Property
Private Sub PropertyChangedHandler()
'I Want to know in this Method which property called it: Prenom or
Nom...
End Sub
I could put the name of the property in a paramter like this:
PropertyChangedHandler("Nom") etc. But in my opinion it's not really a nice
solution So is there any way to do it with a solution without everytime
having to use a unique variable? something like the sender-object?
Thanks a lot in advance,
Pieter
How can I know inside a given method, by which method it was called?
For instance: I have two property's (Prenom and Nom), both call the Method
PropertyChangedHandler(). How Can I know if PropertyChangedHandle was called
by the Prenom or by Nom?
Public Event PrenomChanged As EventHandler
Public Property Prenom() As String
Get
Return m_strPrenom
End Get
Set(ByVal Value As String)
m_strPrenom = Value
RaiseEvent PrenomChanged(Me, New EventArgs())
PropertyChangedHandler()
End Set
End Property
Public Event NomChanged As EventHandler
Public Property Nom() As String
Get
Return m_strNom
End Get
Set(ByVal Value As String)
m_strNom = Value
RaiseEvent NomChanged(Me, New EventArgs())
PropertyChangedHandler()
End Set
End Property
Private Sub PropertyChangedHandler()
'I Want to know in this Method which property called it: Prenom or
Nom...
End Sub
I could put the name of the property in a paramter like this:
PropertyChangedHandler("Nom") etc. But in my opinion it's not really a nice
solution So is there any way to do it with a solution without everytime
having to use a unique variable? something like the sender-object?
Thanks a lot in advance,
Pieter