Exemple #1
0
 public string ConvertToString(object value, CsvHelper.IWriterRow row, CsvHelper.Configuration.MemberMapData memberMapData)
 {
     if (FromObject == null)
     {
         throw new NotImplementedException();
     }
     return(FromObject((T)value));
 }
Exemple #2
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);
            }
Exemple #4
0
 public virtual string ConvertToString(object value, CsvHelper.IWriterRow row, CsvHelper.Configuration.MemberMapData memberMapData)
 {
 }
Exemple #5
0
 public abstract object ConvertFromString(string text, CsvHelper.IReaderRow row, CsvHelper.Configuration.MemberMapData memberMapData);
            public override string ConvertToString(object value, CsvHelper.IWriterRow row, CsvHelper.Configuration.MemberMapData memberMapData)
            {
                if (value == null)
                {
                    return(string.Empty);
                }

                var boolValue = (bool)value;

                return(boolValue ? "Yes" : "No");
            }