Beispiel #1
0
 public object ConvertFromString(string text, CsvHelper.IReaderRow row, CsvHelper.Configuration.MemberMapData memberMapData)
 {
     if (FromString == null)
     {
         throw new NotImplementedException();
     }
     return(FromString(text));
 }
            public override object ConvertFromString(string text, CsvHelper.IReaderRow row, CsvHelper.Configuration.MemberMapData memberMapData)
            {
                if (text == null)
                {
                    return(string.Empty);
                }

                return(text.ToLower() == "yes" ? true : false);
            }
Beispiel #3
0
        private static DateTime GetStartTime(CsvHelper.IReaderRow row)
        {
            string date = row.GetField(3);
            string time = row.GetField(4);

            if (string.IsNullOrEmpty(date) || string.IsNullOrEmpty(time))
            {
                return(DateTime.MinValue);
            }
            return(Parser.ParseDateTime(date, time));
        }
Beispiel #4
0
        public override object ConvertFromString(string text, CsvHelper.IReaderRow row, MemberMapData memberMapData)
        {
            var s = text.ToLower().Trim();

            if (s == "n")
            {
                return(false);
            }

            if (s == "y")
            {
                return(true);
            }

            throw new ArgumentException($"Expected Y|N, got {text}.");
        }
Beispiel #5
0
 protected System.Globalization.CultureInfo GetCultureInfo(CsvHelper.IReaderRow row)
 {
 }
Beispiel #6
0
 public abstract object ConvertFromString(string text, CsvHelper.IReaderRow row, CsvHelper.Configuration.MemberMapData memberMapData);
Beispiel #7
0
 protected override System.Nullable <ushort> ConvertStringToActualType(CsvHelper.IReaderRow row, string text)
 {
 }
Beispiel #8
0
 protected abstract TNullable ConvertStringToActualType(CsvHelper.IReaderRow row, string text);