Hi all...
We have an exception ocurred in our project due to the use of "Define a Csla Property" snippet:
Set(ByVal value As $PropertyType$)
CanWriteProperty(True)
If Not $PrivateVariable$.Equals(value) Then
$PrivateVariable$ = value
PropertyHasChanged()
End If
End Set
When editing a string property in a grid. If you delete the cell content the $PrivateVariable$ value will be Nothing. The equals function causes an exception when setting a correct value because $PrivateVariable$ is Nothing.
We propose to change the line, as in Project Tracker, for using the <> operator.
The only side effect is that all our property types must implement the <> operator. But this can be noticed when coding. The we could choose to use Equals with Nothing check or implement the <> operator.
What do you think about?
Thanks.
Emilio.
I think I understand what you are trying to say, I had an
issue with this before.
I found that the declaration was causing the issue, if you have a string value
you will need to set it to string.empty in the declaration.
Dim _Value as String = String.Empty and then you can evaluate the value when
setting the property.
Tim.
Tim, is not a question of variable inizialization.
The thing is that the Datagridview is sending Nothing to my property when I delete the cell contents (in this case the property is a string). Then when I write a correct value on the cell the equals fuction fails becasuse the member variable is nothing.
Thanks anyway...
Emilio.
Copyright (c) Marimer LLC