How to get MethodInfo for basic methods, and not properties and events, through reflection?

I am doing a reflexive polling of an object. The code lists the constructors, properties, and methods. GetMethods( )returns properties of accessor / mutator methods and methods for adding / removing events.

How can I get only basic method definitions?

Update

.IsSpecialName  

- operational property. Thanks, @Hans.

+5
source share
1 answer

The next answer from this post is filtering the automatically generated methods getter / setter / add / remove / .etc) returned by Type.GetMethods () should work

typeof(MyType)
.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
.Where(m => !m.IsSpecialName)
+7
source

All Articles