コード例 #1
0
        /// <summary>
        /// Save Subtitle Server to Config File
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ServerComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem typeItem = (ComboBoxItem)cmbSubServer.SelectedItem;

            if (!typeItem.Content.ToString().Equals(GlobalData.Config.ServerUrl))
            {
                GlobalData.Config.ServerUrl = typeItem.Content.ToString();
                GlobalData.Save();
                TitleElement.SetTitle(cmbSubServer, string.Format(Properties.Langs.Lang.SubtitleLanguage, GlobalData.Config.ServerUrl));
            }
        }
コード例 #2
0
        /// <summary>
        /// Get settings value from config file
        /// </summary>
        private void InitSettings()
        {
            txtBrowse.Text = GlobalData.Config.StoreLocation;

            autoDownload.IsChecked      = GlobalData.Config.IsAutoDownloadSubtitle;
            selectTab.IsChecked         = GlobalData.Config.IsAutoSelectOpenedTab;
            tabIsDraggable.IsChecked    = GlobalData.Config.IsDraggableTab;
            contextMenuFile.IsChecked   = GlobalData.Config.IsContextMenuFile;
            contextMenuFolder.IsChecked = GlobalData.Config.IsContextMenuFolder;
            showNotification.IsChecked  = GlobalData.Config.IsShowNotification;
            showNotifyIcon.IsChecked    = GlobalData.Config.IsShowNotifyIcon;

            TitleElement.SetTitle(cmbSubLang, string.Format(Properties.Langs.Lang.SubtitleLanguage, GlobalData.Config.SubtitleLang));
            TitleElement.SetTitle(cmbSubServer, string.Format(Properties.Langs.Lang.Server, GlobalData.Config.ServerUrl));

            foreach (string item in _colorPresetList)
            {
                PART_PanelColor.Children.Add(CreateColorButton(item));
            }
        }