public double TestEt() { DateTime start = DateTime.Now; while ((TestedPark.FirstFlat.isEmpty() && TestedPark.SecondFlat.isEmpty() && TestedPark.Basement.isEmpty()) != true) { TestedPark.deleteCar(); } DateTime stop = DateTime.Now; FakeData(TestedPark); return(stop.Subtract(start).TotalMilliseconds); }
private void btnCikar_Click(object sender, EventArgs e) { // show the informations pnlInformations.Visible = true; // First Flat Operations inorder: show the picture of leaving car, show the information label, remove the image from list int imageIndex = ilistFirstFlat.Images.IndexOfKey(_Autopark.FirstFlat.Data[_Autopark.FirstFlat.front].id.ToString()); if (imageIndex != -1) { picLeavingCar.BackgroundImage = ilistFirstFlat.Images[imageIndex]; lblLeavingCarInfo.Text = "45 CCO " + _Autopark.FirstFlat.Peek().id + " left the car park."; } ilistFirstFlat.Images.RemoveByKey(_Autopark.FirstFlat.Peek().id.ToString()); // Let the front car left the car park. _Autopark.deleteCar(); if (!_Autopark.FirstFlat.isEmpty()) { // ** ImageList-ListView Operations ** int deletedCarId = _Autopark.FirstFlat.Data[_Autopark.FirstFlat.rear].id; if (deletedCarId < 15 || deletedCarId == 0) { imageIndex = ilistSecondFlat.Images.IndexOfKey(deletedCarId.ToString()); if (imageIndex != -1) { ilistFirstFlat.Images.Add(deletedCarId.ToString(), ilistSecondFlat.Images[imageIndex]); picQueuedCar.BackgroundImage = ilistSecondFlat.Images[imageIndex]; ilistSecondFlat.Images.RemoveByKey(deletedCarId.ToString()); } if (ilistSecondFlat.Images.Empty) { lvwSecondFlat.Visible = false; } } if (deletedCarId > 29) { imageIndex = ilistBasement.Images.IndexOfKey(deletedCarId.ToString()); if (imageIndex != -1) { ilistFirstFlat.Images.Add(deletedCarId.ToString(), ilistBasement.Images[imageIndex]); picQueuedCar.BackgroundImage = ilistBasement.Images[imageIndex]; ilistBasement.Images.RemoveByKey(deletedCarId.ToString()); } if (ilistBasement.Images.Empty) { lvwBasement.Visible = false; } } lblInlinedCarInfo.Visible = true; lblInlinedCarInfo.Text = "45 CCO " + _Autopark.FirstFlat.Data[_Autopark.FirstFlat.rear].id + " added to 1. Flat."; } else { pnlInformations.Visible = false; btnEmptyNotification.Visible = true; btnCikar.Visible = false; lvwFirstFlat.Visible = false; } Listele(); }