예제 #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)
         {
             MccPilot mcc = new MccPilot(dr);
             CSVImporter.WriteEntryToDataTable(mcc.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)
                {
                    MccPilot mcc = new MccPilot(dr, rgcpt);
                    CSVImporter.WriteEntryToDataTable(mcc.ToLogbookEntry(), dtDst);
                }
                return(CsvWriter.WriteToString(dtDst, true, true));
            }
        }