private void InitializationTaxopark(string[] Path) { Passenger passenger = new Passenger(); SmallCargo smallCargo = new SmallCargo(); BigCargo bigCargo = new BigCargo(); FrozenBigCargo frozenBigCargo = new FrozenBigCargo(); LiquidBigCargo liquidBigCargo = new LiquidBigCargo(); InitializationPassenger(passenger, Path[0]); InitializationSmallCargo(smallCargo, Path[1]); InitializationBigCargo(bigCargo, Path[4]); InitializationLiquidBigCargo(liquidBigCargo, Path[2]); InitializationFrozenBigCargo(frozenBigCargo, Path[3]); //using (StreamReader stream = new StreamReader(Path[i], System.Text.Encoding.Default)) //{ // while (!stream.EndOfStream) // { // string Buffer = stream.ReadLine(); // string[] CarInformation = Buffer.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // InitializationAbstractCarsInformation(passenger, CarInformation); // InitializationPassenger(passenger, CarInformation); // PassengerCars.Add(passenger); // passenger = new Passenger(); // } //} }
private void InitializationLiquidBigCargo(LiquidBigCargo liquidBigCargo, string Path) { using (StreamReader stream = new StreamReader(Path, System.Text.Encoding.Default)) { while (!stream.EndOfStream) { string Buffer = stream.ReadLine(); string[] CarInformation = Buffer.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); InitializationAbstractCarsInformation(liquidBigCargo, CarInformation); liquidBigCargo.PropLoadCapacity = Convert.ToDouble(CarInformation[7]); liquidBigCargo.PropTotalVolum = Convert.ToInt32(CarInformation[8]); liquidBigCargo.PropAmountTrailer = Convert.ToInt32(CarInformation[9]); liquidBigCargo.PropAmountEuroPalet = Convert.ToInt32(CarInformation[10]); liquidBigCargo.PropTypeTrailer = CarInformation[11]; liquidBigCargo.PropTypeCistern = CarInformation[12]; liquidBigCargo.PropTypeBlower = CarInformation[13]; liquidBigCargo.PropMaxPressure = Convert.ToDouble(CarInformation[14]); LiquidBigCargoCars.Add(liquidBigCargo); Cars.Add(liquidBigCargo); liquidBigCargo = new LiquidBigCargo(); } } }