mardi 24 janvier 2017

Can't access private field with Type.GetMember in wpf

The following code fails to find private fields, for example if host is Application.Current and member is "_ownDispatcherStarted", it returns an empty array, but if if I look for a private property, for example member is "ParkingHwnd", it returns an array of length 1; it finds it ok. Why is that?

        var hostType = host.GetType();
        var members = host.GetType()
            .GetMember(member, Public | NonPublic | Instance | FlattenHierarchy);





Aucun commentaire:

Enregistrer un commentaire