dimanche 28 mai 2017

Get internal constructor in UWP

How to get internal parametrized constructor in UWP.

Why there is no such overload in UWP?

var ctr = typeof(T).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, 
                                   null, CallingConventions.HasThis, 
                                   new[] {typeof(IBuffer)}, null);

The only overload i can call in UWP is this

var ctr = typeof(T).GetConstructor(new[]{typeof(IBuffer)});

Which only gets public constructors.





Aucun commentaire:

Enregistrer un commentaire