Ejemplo n.º 1
0
        /// <summary>
        /// Converts a data item to a string.
        /// </summary>
        /// <param name="col">The data column.</param>
        /// <param name="index">Index of the item in the data column, which should be converted.</param>
        /// <returns>The converted item as string.</returns>
        public string DataItemToString(Altaxo.Data.DataColumn col, int index)
        {
            if (col.IsElementEmpty(index))
            {
                return(string.Empty);
            }

            string result;

            if (_typeConverters.TryGetValue(col.GetType(), out var func))
            {
                result = func(col[index]);
            }
            else
            {
                result = DefaultTextConverter(col[index]);
            }

            return(result.Replace(SeparatorChar, SubstituteForSeparatorChar));
        }