Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting method in sub class
Message
De
24/03/2015 14:46:03
 
 
À
24/03/2015 13:06:42
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:
01617212
Vues:
30
>>Essentially yes - but could be simplified:
Dim loMethodInfo = toOriginator.GetMethod(tcMethod, System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.Public)
>>
>>return (loMethodInfo IsNot Nothing AndAlso loMethodInfo.ReflectedType = loMethodInfo.DeclaringType)
>
>We cannot call toOriginator.GetMethod() directly as this will generate an error.

So just this in the method (you don't need the variable for loType):
Dim loMethodInfo = toOriginator.[GetType]().GetMethod(tcMethod, System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.[Public])
Return (loMethodInfo IsNot Nothing AndAlso loMethodInfo.ReflectedType = loMethodInfo.DeclaringType)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform