private static void CreateFuelDispenser(FuelDispenser fuelDispenser, Point creationPoint) { var speedOfFilling = fuelDispenser.FuelFeedRateInLitersPerMinute; //var speedOfFilling = 15; var fuelView = CreateFuelDispenserView("Fuel Dispenser", speedOfFilling); CreateFuelDispenserPictureBox(fuelView, creationPoint); }
private void ShowClickedFuelDispenserProperties(DataGridViewImageCell cell) { FuelDispenser clickedFuelDispenser = cell.Tag as FuelDispenser; clickedElement = clickedFuelDispenser; MakePropertiesControls1Visible(); labelElementProperty1.Text = "Скорость подачи"; nudElementProperty1.Minimum = FuelDispenser.MinFuelFeedRateInLitersPerMinute; nudElementProperty1.Maximum = FuelDispenser.MaxFuelFeedRateInLitersPerMinute; nudElementProperty1.Value = clickedFuelDispenser.FuelFeedRateInLitersPerMinute; }
public bool AddFuelDispenser(int x, int y, FuelDispenser fuelDispenser) { if (CanAddFuelDispenser(x, y)) { DataGridViewImageCell cell = (DataGridViewImageCell)field.Rows[y].Cells[x]; cell.Value = FuelDispenser.Image; cell.Tag = fuelDispenser; FuelDispensersCount++; return(true); } return(false); }
private void nudElementProperty1_ValueChanged(object sender, EventArgs e) { if (clickedElement is CashCounter) { CashCounter cashCounter = (CashCounter)clickedElement; cashCounter.CashInRubles = (int)nudElementProperty1.Value; } else if (clickedElement is FuelDispenser) { FuelDispenser fuelDispenser = (FuelDispenser)clickedElement; fuelDispenser.FuelFeedRateInLitersPerMinute = (int)nudElementProperty1.Value; } else if (clickedElement is FuelTank) { FuelTank fuelTank = (FuelTank)clickedElement; fuelTank.Volume = (int)nudElementProperty1.Value; nudElementProperty2.Maximum = fuelTank.Volume; } }