コード例 #1
0
        private void Window_Opened(object sender, EventArgs e)
        {
            Height = _prefsShown ? 477 : 277;
            Width  = 504;

            if (Environment.OSVersion.Version.Major > 5 && ConfigManager.SettingsManager.LoadSetting("ControlCenter", "AeroWarning", true))
            {
                bool aeroEnabled;
                NativeMethods.DwmIsCompositionEnabled(out aeroEnabled);
                if (!aeroEnabled)
                {
                    AeroWarning warningDialog = new AeroWarning();
                    warningDialog.Owner = this;
                    warningDialog.ShowDialog();

                    if (warningDialog.DisplayAgainCheckbox.IsChecked == true)
                    {
                        ConfigManager.SettingsManager.SaveSetting("ControlCenter", "AeroWarning", false);
                    }
                }
            }

            App app = Application.Current as App;

            if (app != null && app.StartupProfile != null && File.Exists(app.StartupProfile))
            {
                LoadProfileList(app.StartupProfile);
                LoadProfile(app.StartupProfile);
                StartProfile();
            }

            VersionChecker.CheckVersion();
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: appsou/Helios
        private void Window_Opened(object sender, EventArgs e)
        {
            if (Environment.OSVersion.Version.Major > 5 && PreferencesFile.LoadSetting("ControlCenter", "AeroWarning", true))
            {
                bool aeroEnabled;
                NativeMethods.DwmIsCompositionEnabled(out aeroEnabled);
                if (!aeroEnabled)
                {
                    AeroWarning warningDialog = new AeroWarning();
                    warningDialog.Owner = this;
                    warningDialog.ShowDialog();

                    if (warningDialog.DisplayAgainCheckbox.IsChecked == true)
                    {
                        PreferencesFile.SaveSetting("ControlCenter", "AeroWarning", false);
                    }
                }
            }


            App app = Application.Current as App;

            if (app != null && app.StartupProfile != null && File.Exists(app.StartupProfile))
            {
                LoadProfileList(app.StartupProfile);
                LoadProfile(app.StartupProfile);
                StartProfile();
            }

            VersionChecker.Check versionCheck = ConfigManager.VersionChecker.CheckAvailableVersion(false);
            if (!ConfigManager.VersionChecker.ShouldOfferNewVersion(versionCheck))
            {
                return;
            }

            // can't use the interactive dialog, because this would require writing settings
            StatusMessage = StatusValue.UpgradeAvailable;

            StatusReportItem item = new StatusReportItem
            {
                Status = $"new version {versionCheck.AvailableVersion} is available",
                Flags  = StatusReportItem.StatusFlags.ConfigurationUpToDate
            };

            if (versionCheck.DownloadUrl != null)
            {
                item.Link           = new Uri(versionCheck.DownloadUrl);
                item.Recommendation = $"Use Profile Editor to check for new version or download directly from {versionCheck.DownloadUrl}";
            }
            else
            {
                item.Link           = StatusReportItem.ProfileEditor;
                item.Recommendation = "check for new version and download it";
            }
            StatusViewer.AddItem(item);
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: Heliflyer/helios
        private void Window_Opened(object sender, EventArgs e)
        {
            Height = _prefsShown ? 477 : 277;
            Width = 504;

            if (Environment.OSVersion.Version.Major > 5 && ConfigManager.SettingsManager.LoadSetting("ControlCenter", "AeroWarning", true))
            {
                bool aeroEnabled;
                NativeMethods.DwmIsCompositionEnabled(out aeroEnabled);
                if (!aeroEnabled)
                {
                    AeroWarning warningDialog = new AeroWarning();
                    warningDialog.Owner = this;
                    warningDialog.ShowDialog();

                    if (warningDialog.DisplayAgainCheckbox.IsChecked == true)
                    {
                        ConfigManager.SettingsManager.SaveSetting("ControlCenter", "AeroWarning", false);
                    }
                }
            }

            App app = Application.Current as App;
            if (app != null && app.StartupProfile != null && File.Exists(app.StartupProfile))
            {
                LoadProfileList(app.StartupProfile);
                LoadProfile(app.StartupProfile);
                StartProfile();
            }

            VersionChecker.CheckVersion();
        }