Esempio n. 1
0
        private void NewTrain(GridView view)
        {
            using (var trf = TrainRouteForm.NewTrain(info))
            {
                if (trf.ShowModal(this) != DialogResult.Ok)
                {
                    return;
                }

                using (var tef = new TrainEditForm(info.Timetable, TrainDirection.tr, trf.Path))
                {
                    if (tef.ShowModal(this) == DialogResult.Ok)
                    {
                        tt.AddTrain(tef.Train, true);

                        UpdateListView(view, TrainDirection.tr);
                    }
                }
            }
        }
Esempio n. 2
0
        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);
                    }
                }
            }
        }