Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating on Overridable method
Message
De
05/09/2011 12:30:39
 
 
À
03/09/2011 00:40:21
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01522449
Message ID:
01522737
Vues:
18
>If I understand your question correctly, you can just call your validation first:
>
>
>        Private Function DataEntry() As Boolean
>...
>          If ValidateBeforeIntializeWithRow() Then
>            ' Initialization code with row
>            If Not InitializeWithRow() Then
>                Return False
>            End If
>          End If
>...
>            Return True
>        End Function
>
>        Private Function ValidateBeforeIntializeWithRow() As Boolean
>          ' validation code here
>        End Function
>
>        Public Overridable Function InitializeWithRow() As Boolean
>            Return True
>        End Function
>
>
>Now, perhaps you meant you only wanted to do that validation *IF* the sub-class overrode the InitializeWithRow() function and you're right, there's no way to know that. Depending on what this validation is supposed to do, it may not matter if it runs even when there's Override.

I am looking at Viv's approach to see if that could help.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform