Exemplo n.º 1
0
        private string GetCombinedRowValuesFor(DataRow row)
        {
            IEnumerable <string> values;

            if (SelectedEnclosure.Equals("None"))
            {
                values = row.ItemArray.Select(x => x.ToString());
            }
            else
            {
                values = row.ItemArray.Select(x => "\"" + x + "\"");
            }

            string combinedValues;

            if (SelectedSeparator.Equals("Tab"))
            {
                return(combinedValues = string.Join("\t", values));
            }
            else
            {
                return(combinedValues = string.Join(SelectedSeparator, values));
            }
        }
Exemplo n.º 2
0
        private string GetCombinedColumnHeadersFor(List <Column> columns)
        {
            IEnumerable <string> columnHeaders;

            if (SelectedEnclosure.Equals("None"))
            {
                columnHeaders = columns.Select(x => x.Name);
            }
            else
            {
                columnHeaders = columns.Select(x => "\"" + x.Name + "\"");
            }

            string combinedColumnHeaders;

            if (SelectedSeparator.Equals("Tab"))
            {
                return(combinedColumnHeaders = string.Join("\t", columnHeaders));
            }
            else
            {
                return(combinedColumnHeaders = string.Join(SelectedSeparator, columnHeaders));
            }
        }