Represents the content-pipeline version of RuntimeCsvRepresentation.
Inheritance: FlatRedBall.IO.Csv.RuntimeCsvRepresentation
Esempio n. 1
0
        private void WriteToStream(BinaryWriter writer, BuildtimeCsvRepresentation csvInput)
        {
            // write the number of rows
            writer.Write(csvInput.Records.Count);

            // write the number of columns
            writer.Write(csvInput.Headers.Length);

            // write the headers
            for (int i = 0; i < csvInput.Headers.Length; i++)
            {
                writer.Write(csvInput.Headers[i].Name);
            }

            // write the records
            foreach (string[] record in csvInput.Records)
            {
                for (int i = 0; i < record.Length; i++)
                {
                    if (string.IsNullOrEmpty(record[i]))
                    {
                        writer.Write("");
                    }
                    else
                    {
                        writer.Write(record[i]);
                    }
                }
            }
        }
Esempio n. 2
0
        public override TImport Import(string filename, ContentImporterContext context)
        {
            BuildtimeCsvRepresentation buildtimeCsvRepresentation = CsvFileManager.CsvDeserializeToRuntime <BuildtimeCsvRepresentation>(filename);

            return(buildtimeCsvRepresentation);
        }