Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Globalization.ApplyTranslations(this);
            Task t = new Task(() => Sync());

            t.Start();
        }
Exemplo n.º 2
0
        private void settingLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (AppPrefs.Instance.language != settingLanguage.SelectedIndex)
            {
                AppPrefs.Instance.language = settingLanguage.SelectedIndex;
                Globalization.SetSelectedLanguage(settingLanguage.SelectedIndex);

                // This will apply some translations but not all since some are created in code instead of being tagged on the xaml
                Globalization.ApplyTranslations(this);
                if (tabControl.Items.Count > 1)
                {
                    for (int i = 1; i < tabControl.Items.Count; ++i)
                    {
                        Globalization.ApplyTranslations(tabControl.Items[i] as DependencyObject);
                    }
                }

                MessageBox.Show(
                    Globalization.Translate("Restart_Msg"),
                    Globalization.Translate("Restart"),
                    MessageBoxButton.OK);
            }
        }
Exemplo n.º 3
0
 private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     Globalization.ApplyTranslations(this);
 }
Exemplo n.º 4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Globalization.ApplyTranslations(this);

            foreach (string language in Globalization.GetAvailableLanguages())
            {
                var languageBox = new ComboBoxItem
                {
                    Content = language
                };
                settingLanguage.Items.Add(languageBox);
            }

            settingLanguage.SelectedIndex = AppPrefs.Instance.language;

            // Get the application version
            try
            {
                Version version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
                versionLabel.Content = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
            }
            catch { }

            // Check if auto start is enabled via registry
            try
            {
                RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
                settingAutoStart.IsChecked |= key.GetValue("WiinUPro") != null;
            }
            catch { }

            // Check if auto start is enabled
            settingAutoStart.IsChecked = AppPrefs.Instance.GetAutoStartSet();

            // Check Suppress Connection Lost
            settingSuppressLostConn.IsChecked = AppPrefs.Instance.suppressConnectionLost;

            // Check Auto Add Xinput Devices
            if (AppPrefs.Instance.autoAddXInputDevices)
            {
                settingAutoAddXInputDevices.IsChecked = true;
                settingProfileQueuing.IsEnabled       = true;
            }

            SetXInputDeviceStatus(ScpDirector.XInput_Device.Device_A);
            SetXInputDeviceStatus(ScpDirector.XInput_Device.Device_B);
            SetXInputDeviceStatus(ScpDirector.XInput_Device.Device_C);
            SetXInputDeviceStatus(ScpDirector.XInput_Device.Device_D);

            // Check Start Minimized
            if (AppPrefs.Instance.startMinimized)
            {
                settingStartMinimized.IsChecked = true;
                HideWindow();
            }

            // Check Exclusive Mode
            if (AppPrefs.Instance.useExclusiveMode)
            {
                settingExclusiveMode.IsChecked = true;
                settingExclusiveMode_Checked(this, new RoutedEventArgs());
            }

            // Check Toshiba Mode
            if (AppPrefs.Instance.useToshibaMode)
            {
                settingToshibaMode.IsChecked = true;
                settingToshibaMode_Checked(this, new RoutedEventArgs());
            }

            // Check Minimize To System Tray
            settingMinimizeOnClose.IsChecked = AppPrefs.Instance.minimizeToTray;

            // Check Profile Queuing
            settingProfileQueuing.IsChecked = AppPrefs.Instance.profileQueuing;

            Refresh();
        }