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 InitializationSmallCargo(SmallCargo smallCargo, 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(smallCargo, CarInformation); smallCargo.PropLoadCapacity = Convert.ToDouble(CarInformation[7]); smallCargo.PropTotalVolum = Convert.ToInt32(CarInformation[8]); smallCargo.PropDelicateStaff = CarInformation[9]; smallCargo.PropTypeFixator = CarInformation[10]; SmallCargoCars.Add(smallCargo); Cars.Add(smallCargo); smallCargo = new SmallCargo(); } } }