コード例 #1
0
 private static void WriteHeader(ExtractHouseholdData root, StreamWriter writer)
 {
     writer.Write("PD,");
     for (int i = 0; i < root.AgeSets.Count; i++)
     {
         writer.Write(root.AgeSets[i].ToString());
         writer.Write(',');
     }
     writer.WriteLine("Vehicles,ExpansionFactor");
 }
コード例 #2
0
 internal void Save(ExtractHouseholdData root)
 {
     using (StreamWriter writer = new StreamWriter(root.SaveFile.GetFileName()))
     {
         WriteHeader(root, writer);
         for (int i = 0; i < this.EntryList.Count; i++)
         {
             var entry = this.EntryList[i];
             writer.Write(entry.PlanningDistrict);
             writer.Write(',');
             for (int j = 0; j < entry.AgeCategoryCount.Length; j++)
             {
                 writer.Write(entry.AgeCategoryCount[j]);
                 writer.Write(',');
             }
             writer.Write(entry.NumberOfCars);
             writer.Write(',');
             writer.WriteLine(entry.ExpandedTotal);
         }
     }
 }
コード例 #3
0
ファイル: ExtractHouseholdData.cs プロジェクト: Cocotus/XTMF
 private static void WriteHeader(ExtractHouseholdData root, StreamWriter writer)
 {
     writer.Write( "PD," );
     for ( int i = 0; i < root.AgeSets.Count; i++ )
     {
         writer.Write( root.AgeSets[i].ToString() );
         writer.Write( ',' );
     }
     writer.WriteLine( "Vehicles,ExpansionFactor" );
 }
コード例 #4
0
ファイル: ExtractHouseholdData.cs プロジェクト: Cocotus/XTMF
 internal void Save(ExtractHouseholdData root)
 {
     using ( StreamWriter writer = new StreamWriter( root.SaveFile.GetFileName() ) )
     {
         WriteHeader( root, writer );
         for ( int i = 0; i < this.EntryList.Count; i++ )
         {
             var entry = this.EntryList[i];
             writer.Write( entry.PlanningDistrict );
             writer.Write( ',' );
             for ( int j = 0; j < entry.AgeCategoryCount.Length; j++ )
             {
                 writer.Write( entry.AgeCategoryCount[j] );
                 writer.Write( ',' );
             }
             writer.Write( entry.NumberOfCars );
             writer.Write( ',' );
             writer.WriteLine( entry.ExpandedTotal );
         }
     }
 }