+ 6

Question | GetMethods(BindingFlags flag)

Hello. Why when I use GetMethods() with any flags(BindingFlags.Public, BindingFlags.DeclaredOnly, ...)- here no detected methods? Without flags - okay. https://code.sololearn.com/cDqgPVMserdZ/?ref=app

9th Oct 2017, 2:13 PM
Podretyz
Podretyz - avatar
2 Respostas
+ 1
You must specify Instance or Static along with Public or NonPublic or no members will be returned. like this: GetMembers(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public);
9th Oct 2017, 3:00 PM
HAL8999++;
HAL8999++; - avatar
+ 7
Thank you HAL8999+;. I understand :)
9th Oct 2017, 3:05 PM
Podretyz
Podretyz - avatar