/// <summary> /// Load Settings data. /// </summary> public void LoadData() { Entries.Add(new LanguageSettingsEntry(CommonSharedStrings.GetString("UseOSLanguageSettings"), string.Empty)); Entries.Add(new LanguageSettingsEntry("English (United States)", "en-US")); Entries.Add(new LanguageSettingsEntry("English (United Kingdom)", "en-GB")); Entries.Add(new LanguageSettingsEntry("简体中文 (中华人民共和国)", "zh-CN")); var isOverrideLangSet = false; for (int i = 0; i < Entries.Count; i++) { if (_currentSelection == Entries[i].LanguageTag) { SelectedIndex = i; isOverrideLangSet = true; break; } } if (!isOverrideLangSet) { SelectedIndex = 0; } IsRestartPromptVisible = _currentSelection != _currentLanguageOverride; _isOperationable = true; }
public void LoadData() { Entries.Add(new SampleRateSettingsEntry(0, CommonSharedStrings.GetString("UseSystemSampleRate"))); Entries.Add(new SampleRateSettingsEntry(44100, "44100 Hz")); Entries.Add(new SampleRateSettingsEntry(48000, "48000 Hz")); Entries.Add(new SampleRateSettingsEntry(88200, "88200 Hz")); Entries.Add(new SampleRateSettingsEntry(96000, "96000 Hz")); Entries.Add(new SampleRateSettingsEntry(192000, "192000 Hz")); var isCurrentSet = false; for (int i = 0; i < Entries.Count; i++) { if (_currentSelection == Entries[i].SampleRate) { SelectedIndex = i; isCurrentSet = true; break; } } if (!isCurrentSet) { SelectedIndex = 0; } RefreshSystemSampleRate(); CheckNextTrackPromptVisibility(); _isOperationable = true; }
/// <summary> /// Share a file. /// </summary> /// <param name="file">The file to be shared.</param> /// <returns>An awaitable task.</returns> public static async Task ShareAsync(this DbMediaFile fileEntity) { var shareService = ShareServices.GetForCurrentView(); shareService.PrecleanForSession(); // FIXME: External file should still set this field, but they should retrieve file from MRU. // Currently no external files will be shared. await shareService.AddFileAsync(fileEntity.Path); shareService.Title = fileEntity.Title; shareService.Description = string.Format(CommonSharedStrings.GetString(SongDescriptionFieldId), fileEntity.Album, fileEntity.AlbumArtist, MiliSecToNormalTimeConverter.GetTimeStringFromTimeSpanOrDouble(fileEntity.Duration)); shareService.ShowShareUI(); }
/// <summary> /// General method for showing dialogs. /// </summary> /// <param name="dialogTag"></param> /// <returns></returns> private async Task ShowMessageDialogAsync(string dialogTag) { var messageDialog = new MessageDialog(CommonSharedStrings.GetString($"{dialogTag}Message"), CommonSharedStrings.GetString($"{dialogTag}Title")); await messageDialog.ShowAsync(); }