private void CreateVRoute() { using var tpf = TrainPathForm.NewTrain(pluginInterface); tpf.Title = T._("Verlauf der neuen virtuellen Strecke auswählen"); if (tpf.ShowModal(this) != DialogResult.Ok) { return; } VirtualRoute.CreateVRoute(tt, tpf.Path.First(), tpf.Path.Last(), tpf.Waypoints.ToArray()); gridView.DataStore = VirtualRoute.GetVRoutes(tt).ToArray(); }
private void NewTrain(GridView view) { using (var tpf = TrainPathForm.NewTrain(pluginInterface)) { if (tpf.ShowModal(this) != DialogResult.Ok) { return; } using (var tef = new TrainEditForm(pluginInterface.Timetable, TrainDirection.tr, tpf.Path)) { if (tef.ShowModal(this) == DialogResult.Ok) { tt.AddTrain(tef.Train); if (tef.NextTrains.Any()) { tt.SetTransitions(tef.Train, tef.NextTrains); } UpdateListView(view, TrainDirection.tr); } } } }