Example #1
0
File: Row.cs Project: lie112/ApsimX
        /// <summary>
        /// 'Flatten' the row passed in, into a list of columns ready to be added
        /// to a data table.
        /// </summary>
        public void Flatten()
        {
            List <string> newColumnNames = new List <string>();
            List <string> newColumnUnits = new List <string>();
            List <object> newValues      = new List <object>();

            for (int i = 0; i < Values.Count(); i++)
            {
                string units = null;
                if (ColumnUnits != null)
                {
                    units = ColumnUnits.ElementAt(i);
                }
                FlattenValue(ColumnNames.ElementAt(i),
                             units,
                             Values.ElementAt(i),
                             newColumnNames, newColumnUnits, newValues);
            }

            ColumnNames = newColumnNames;
            ColumnUnits = newColumnUnits;
            Values      = newValues;
        }