Beispiel #1
0
        public CSV(AttributeOf selector = null)
        {
            DProperty[] Props;
            Props = DObject.GetProperties <T>();
            var t = new List <DProperty>();
            var x = new List <DProperty>();

            foreach (var p in Props)
            {
                var attr = selector == null ? p.Attribute : selector(p);
                if ((attr & PropertyAttribute.NonSerializable) == PropertyAttribute.NonSerializable)
                {
                    continue;
                }
                if ((attr & PropertyAttribute.SerializeAsId) == PropertyAttribute.SerializeAsId)
                {
                    x.Add(p);
                }
                else
                {
                    t.Add(p);
                }
            }
            FlProps = t.ToArray();
            IdProps = x.ToArray();
            s       = new StringBuilder();
        }