Beispiel #1
0
        private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
            switch ((sender as RadioButton).Name)
            {
            case nameof(rbtnRingDisabled):
                GUIConfig.Ring = 0;
                break;

            case nameof(rbtnRingDefault):
                GUIConfig.Ring = 1;
                break;

            case nameof(rbtnRingCustom):
                GUIConfig.Ring = 2;
                break;
            }
            GUIConfig.Save();
        }
Beispiel #2
0
        public SettingWindow()
        {
            InitializeComponent();
            cbbLanguage.SelectedItem      = cbbLanguage.Items.Cast <ComboBoxItem>().First(p => p.Tag.Equals(Config.Language));
            cbbTheme.SelectedItem         = cbbTheme.Items.Cast <ComboBoxItem>().First(p => p.Tag.Equals(GUIConfig.Theme.ToString()));
            chkStartup.IsChecked          = FzLib.Program.Startup.IsRegistryKeyExist() == FzLib.IO.Shortcut.ShortcutStatus.Exist;
            cbbLanguage.SelectionChanged += cbbLanguage_SelectionChanged;
            cbbTheme.SelectionChanged    += cbbTheme_SelectionChanged;

            switch (GUIConfig.Ring)
            {
            case 0:
                rbtnRingDisabled.IsChecked = true;
                break;

            case 1:
                rbtnRingDefault.IsChecked = true;
                break;

            default:
                if (string.IsNullOrEmpty(GUIConfig.CustomRingPath) || !File.Exists(GUIConfig.CustomRingPath))
                {
                    GUIConfig.Ring            = 1;
                    rbtnRingDefault.IsChecked = true;
                    GUIConfig.CustomRingName  = null;
                    GUIConfig.Save();
                }
                else
                {
                    rbtnRingCustom.IsChecked = true;
                }
                break;
            }
            rbtnRingDisabled.Checked += RadioButton_Checked;
            rbtnRingDefault.Checked  += RadioButton_Checked;
            rbtnRingCustom.Checked   += RadioButton_Checked;

            this.Notify(nameof(Config));
        }
Beispiel #3
0
 private void cbbTheme_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     GUIConfig.Theme = int.Parse((cbbTheme.SelectedItem as ComboBoxItem).Tag as string);
     App.Current.SetTheme();
     GUIConfig.Save();
 }