Ejemplo n.º 1
0
        static void Start(bool screensaver = false)
        {
            string settingsPath = screensaver? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "DGScope.xml") :
                                  Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DGScope.xml");
            RadarWindow radarWindow;

            if (File.Exists(settingsPath))
            {
                radarWindow = TryLoad(settingsPath);
            }
            else
            {
                radarWindow = new RadarWindow();
                if (!screensaver)
                {
                    MessageBox.Show("No config file found. Starting a new config.");
                    PropertyForm propertyForm = new PropertyForm(radarWindow);
                    propertyForm.ShowDialog();
                    radarWindow.SaveSettings(settingsPath);
                }
            }
            radarWindow.Run(screensaver);
        }