private void UpdateFlowLabel(Component temp) { flowLabel.Visible = true; if (temp is Pipeline) { flowLabel.Location = canvas.getMidPoint((Pipeline)temp); } else { flowLabel.Location = new Point(temp.Position.X + 6, temp.Position.Y - 15); } flowLabel.ForeColor = Color.Black; switch (temp.GetType()) { case ComponentType.Pipeline: if (((Pipeline)temp).SafetyLimit < temp.CurrentFlow) { flowLabel.ForeColor = Color.Red; } flowLabel.Text = "F: " + temp.CurrentFlow + " SL: " + ((Pipeline)temp).SafetyLimit; break; case ComponentType.Pump: flowLabel.Text = "F: " + temp.CurrentFlow + " C: " + ((Pump)temp).Capacity; break; default: flowLabel.Text = "Flow: " + temp.CurrentFlow; break; } }