简体   繁体   中英

Does the Pipe in binding flags not represent an 'OR'

I am currently debugging in the immediate window:

-

This returns 0 properties:

type.GetProperties(BindingFlags.Instance)

This also returns 0 properties:

type.GetProperties(BindingFlags.Public)

But this returns both properties:

type.GetProperties(BindingFlags.Instance|BindingFlags.Public)

And so does this:

type.GetProperties(BindingFlags.Public|BindingFlags.Instance)

I would have thought that if it was an or then if both the bottom return true then so should the top two.

Could someone explain to me how this works please?

Please see documentation of GetProperties . You must specify visibility (Public/Private) and if it should be Static or Instance properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM