private void TripButton_Click(object sender, EventArgs e) { if (!driverArrived && tripCreated) { driverArrived = true; TripActionArrived?.Invoke(this, new EventArgs()); tripButton.Text = "Start Trip"; return; } if (!tripStarted && driverArrived) { tripStarted = true; TripActionStartTrip.Invoke(this, new EventArgs()); tripButton.Text = "End Trip"; return; } if (tripStarted) { TripActionEndTrip.Invoke(this, new EventArgs()); return; } }