mardi 24 avril 2018

How to grab all members of a class instance with a given type?

I have a class like

public class Stuff
    {
        public int A;
        public float B;
        public int C;
        public float D;
        public int E;

        public List<float> AllMyFloats { get {/* how to grab B, D,... into new List<float>? */} }
     }

How to grab all its contents of one type (say float in the given sample) and return them on property access?





Aucun commentaire:

Enregistrer un commentaire