Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting method in sub class
Message
From
24/03/2015 14:46:03
 
 
To
24/03/2015 13:06:42
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01617154
Message ID:
01617212
Views:
31
>>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform