jeudi 7 mars 2019

Does the Pipe in binding flags not represent a short circuit '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 a short circuit or then if both the bottom return true then so should the top two.

Could someone explain to me how this works please?





Aucun commentaire:

Enregistrer un commentaire