Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting method in sub class
Message
De
25/03/2015 05:21:38
 
 
À
24/03/2015 15:57:28
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01617154
Message ID:
01617233
Vues:
28
>>So when do you use the parent class implementation ?
>
>I am not sure I understand the question correctly.
>
>All overridable methods are called in the framework class. If the developer implements those methods in the client application, something will be executed.

So you could use interfaces to avoid reflection. Essentially something like this?:
Public Interface IInitializeWithRow
Function InitializeWithRow() As Boolean
End Interface

Public Class BaseClass
Public Function Operation() As Boolean
Dim theClass = TryCast(Me, IInitializeWithRow)
If theClass IsNot Nothing Then
Return theClass.InitializeWithRow()
Else
Return False
End If
End Function
End Class

Public Class ChildClass1
Inherits BaseClass
Implements IInitializeWithRow
Public Function InitializeWithRow() As Boolean Implements IInitializeWithRow.InitializeWithRow
Return True
End Function
End Class

Public Class ChildClass2
Inherits BaseClass
End Class

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform