Exemple #1
0
        public PreviewForm(IPluginInterface pluginInterface)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            this.pluginInterface              = pluginInterface;
            pluginInterface.FileStateChanged += PluginInterface_FileStateChanged;
            pluginInterface.FileOpened       += PluginInterfaceOnFileOpened;

            var mainForm = (FForm)pluginInterface.RootForm;

            if (Screen != null && mainForm.Bounds.TopRight.X + 500 < Screen.Bounds.Width)
            {
                Location = mainForm.Bounds.TopRight + new Point(10, 0);
            }

            this.SizeChanged += (s, e) => panel.Invalidate();

            routesDropDown.SelectedRouteChanged += (s, e) => ResetRenderer();
            dtc.SelectedDaysChanged             += (s, e) =>
            {
                var attrs = new TimetableStyle(pluginInterface.Timetable);
                attrs.RenderDays = dtc.SelectedDays;
                ResetRenderer();
            };

            splitCheckBox.Checked         = pluginInterface.Settings.Get <bool>("bifpl.lock-stations");
            splitCheckBox.CheckedChanged += (s, e) =>
            {
                ResetRenderer();
                pluginInterface.Settings.Set("bifpl.lock-stations", splitCheckBox.Checked.Value);
            };

            adbg = new AsyncDoubleBufferedGraph(panel, pluginInterface)
            {
                RenderingFinished = () =>
                {
                    if (scrollPosition.HasValue)
                    {
                        scrollable.ScrollPosition = scrollPosition.Value;
                    }
                    scrollPosition = null;
                }
            };

            // Initialisierung der Daten
            dtc.SelectedDays = new TimetableStyle(pluginInterface.Timetable).RenderDays;
            routesDropDown.Initialize(pluginInterface);
            routesDropDown.EnableVirtualRoutes = true;
            virtualRoutesButton.Visible        = pluginInterface.Timetable is { Type : TimetableType.Network };
        }
Exemple #2
0
        public PreviewForm(IInfo info)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            this.info              = info;
            info.FileStateChanged += Info_FileStateChanged;

            Resizable = Platform.IsWpf;

            var mainForm = (FForm)info.RootForm;

            if (Screen != null && mainForm.Bounds.TopRight.X + 500 < Screen.Bounds.Width)
            {
                Location = mainForm.Bounds.TopRight + new Point(10, 0);
            }

            routesDropDown.SelectedRouteChanged += (s, e) => ResetRenderer();
            dtc.ValueChanged += (s, e) => ResetRenderer();

            splitCheckBox.Checked         = info.Settings.Get <bool>("bifpl.lock-stations");
            splitCheckBox.CheckedChanged += (s, e) =>
            {
                ResetRenderer();
                info.Settings.Set("bifpl.lock-stations", splitCheckBox.Checked.Value);
            };

            adbg = new AsyncDoubleBufferedGraph(panel)
            {
                RenderingFinished = () =>
                {
                    if (scrollPosition.HasValue)
                    {
                        scrollable.ScrollPosition = scrollPosition.Value;
                    }
                    scrollPosition = null;
                }
            };

            // Initialisierung der Daten
            dtc.Initialize(info);
            routesDropDown.Initialize(info);
        }