示例#1
0
 public override string CSVFromDataTable(DataTable dt)
 {
     if (dt == null)
     {
         throw new ArgumentNullException(nameof(dt));
     }
     using (DataTable dtDst = new DataTable())
     {
         dtDst.Locale = dt.Locale;
         CSVImporter.InitializeDataTable(dtDst);
         foreach (DataRow dr in dt.Rows)
         {
             ForeFlight ltp = new ForeFlight(dr, dictAircraft);
             CSVImporter.WriteEntryToDataTable(ltp.ToLogbookEntry(), dtDst);
         }
         return(CsvWriter.WriteToString(dtDst, true, true));
     }
 }
示例#2
0
        public override string CSVFromDataTable(DataTable dt)
        {
            if (dt == null)
            {
                throw new ArgumentNullException("dt");
            }
            IEnumerable <CustomPropertyType> rgcpt = CustomPropertyType.GetCustomPropertyTypes();

            using (DataTable dtDst = new DataTable())
            {
                dtDst.Locale = dt.Locale;
                CSVImporter.InitializeDataTable(dtDst);
                foreach (DataRow dr in dt.Rows)
                {
                    ForeFlight ltp = new ForeFlight(dr, dictAircraft, rgcpt);
                    CSVImporter.WriteEntryToDataTable(ltp.ToLogbookEntry(), dtDst);
                }
                return(CsvWriter.WriteToString(dtDst, true, true));
            }
        }