예제 #1
0
        private static string[][] GetPropArray()
        {
            var p = new string[Types.Length][];

            for (int i = 0; i < p.Length; i++)
            {
                var pz = ReflectUtil.GetPropertiesPublic(Types[i]);
                p[i] = pz.Concat(CustomProperties).OrderBy(a => a).ToArray();
            }

            // Properties for any PKM
            var any = ReflectUtil.GetPropertiesPublic(typeof(PK1)).Union(p.SelectMany(a => a)).OrderBy(a => a).ToArray();
            // Properties shared by all PKM
            var all = p.Aggregate(new HashSet <string>(p[0]), (h, e) => { h.IntersectWith(e); return(h); }).OrderBy(a => a).ToArray();

            var p1 = new string[Types.Length + 2][];

            Array.Copy(p, 0, p1, 1, p.Length);
            p1[0]             = any;
            p1[p1.Length - 1] = all;

            return(p1);
        }