public PivotEncodeIDataReader(Type[] type, int count)
 {
     writers = new ColumnWriter[type.Length];
     for (int i = 0; i < type.Length; i++)
     {
         writers[i] = new ColumnWriter(type[i], type[i].Name, count);
     }
     values = new object[type.Length];
 }
Exemplo n.º 2
0
        public PivotEncode(Type type, int count)
        {
            PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
            writers = new ColumnWriter[properties.Length];
            for (int i = 0; i < properties.Length; i++)
            {
                writers[i] = new ColumnWriter(properties[i].PropertyType, properties[i].Name, count);
            }

            FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public);
            writers = new ColumnWriter[fields.Length];
            for (int i = 0; i < fields.Length; i++)
            {
                writers[i] = new ColumnWriter(fields[i].FieldType, fields[i].Name, count);
            }
        }