コード例 #1
0
        private async Task OnRefreshTemplatesAsync()
        {
            try
            {
                await GenContext.ToolBox.Repo.RefreshAsync();

                WizardStatus.TemplatesVersion = GenContext.ToolBox.TemplatesVersion;
                await OnNewTemplatesAvailableAsync();

                WizardStatus.NewVersionAvailable = false;
                WizardStatus.SetStatus(StatusViewModel.Information(StringRes.StatusUpdated, true, 5));
            }
            catch (Exception ex)
            {
                WizardStatus.SetStatus(StatusViewModel.Information(StringRes.ErrorSyncRefresh));

                await AppHealth.Current.Error.TrackAsync(ex.ToString());

                await AppHealth.Current.Exception.TrackAsync(ex);
            }
            finally
            {
                WizardStatus.IsLoading = GenContext.ToolBox.Repo.SyncInProgress;
            }
        }
コード例 #2
0
        private async Task OnCheckUpdatesAsync()
        {
            try
            {
                UpdateCanCheckUpdates(false);
                await GenContext.ToolBox.Repo.CheckForUpdatesAsync();
            }
            catch (Exception ex)
            {
                WizardStatus.SetStatus(StatusViewModel.Information(StringRes.ErrorSyncRefresh));
                await AppHealth.Current.Error.TrackAsync(ex.ToString());

                await AppHealth.Current.Exception.TrackAsync(ex);
            }
            finally
            {
                WizardStatus.IsLoading = GenContext.ToolBox.Repo.SyncInProgress;
                UpdateCanCheckUpdates(!GenContext.ToolBox.Repo.SyncInProgress);
            }
        }
コード例 #3
0
        protected async Task BaseInitializeAsync()
        {
            GenContext.ToolBox.Repo.Sync.SyncStatusChanged += SyncSyncStatusChanged;
            try
            {
                await GenContext.ToolBox.Repo.SynchronizeAsync();

                WizardStatus.TemplatesVersion = GenContext.ToolBox.TemplatesVersion;
                WizardStatus.WizardVersion    = GenContext.ToolBox.WizardVersion;
            }
            catch (Exception ex)
            {
                WizardStatus.SetStatus(StatusViewModel.Information(StringRes.ErrorSync));

                await AppHealth.Current.Error.TrackAsync(ex.ToString());

                await AppHealth.Current.Exception.TrackAsync(ex);
            }
            finally
            {
                WizardStatus.IsLoading = GenContext.ToolBox.Repo.SyncInProgress;
                UpdateCanCheckUpdates(!GenContext.ToolBox.Repo.SyncInProgress);
            }
        }