예제 #1
0
        private void UpdateLanguages()
        {
            ProgressBarOverlay.Show(FileLanguage.ProgressOverlay_UpdatingLibrary);

            longRunningOperation = App.Engine.RequestLanguageListUpdate()
                                   .ObserveOnDispatcher()
                                   .Finally(
                () =>
            {
                ProgressBarOverlay.Close();

                longRunningOperation = null;
                PhoneApplicationService.Current.State.Remove(KLanguagesPageUpdateInProgress);

                // leave this page if library contents were deleted (for example
                // on failed update or after user interruption)
                if (App.Engine.ApplicationSettings.AvailableLanguages.LanguageList.Count == -1)
                {
                    MessageBox.Show(FileLanguage.LibraryUnavailableAfterFailedUpdate);
                    NavigationService.GoBack();
                }
            })
                                   .Subscribe <List <LanguageInfo> >(
                languageList => ReloadLanguages(languageList),
                Utils.StandardErrorHandler
                );
        }