Exemplo n.º 1
0
        public string Serialize(ICsvSerializable serializable)
        {
            var keyValuePairList = serializable.ToSerializableEnumerable();

            var rowSample = keyValuePairList.FirstOrDefault();
            if (rowSample == null)
                return string.Empty;

            string[] properties = rowSample.Select(x => x.Key).ToArray();

            PreProcessColumnHeaders(properties);

            string header = string.Join(delimiter, properties);

            var csvdata = new StringBuilder();
            csvdata.AppendLine(header);

            foreach (var row in keyValuePairList)
                csvdata.AppendLine(ToCsvFields(properties, row));

            return csvdata.ToString();
        }
Exemplo n.º 2
0
 private void initializeTabContacts()
 {
     m_Contacts = new GoogleContactsCsvAdapter(m_AppFacade.User);
 }
Exemplo n.º 3
0
 public CsvResult(ICsvSerializable model)
 {
     this.model = model;
 }