예제 #1
0
        private void catalogWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result is Catalog newCatalog)
                {
                    _tileManagement.SetCatalog(newCatalog);
                }
            }
            else
            {
                Log.Error(e.Error);
                labelLastCatalogError.Text    = e.Error.Message;
                labelLastCatalogError.Visible = true;
            }

            buttonRefreshCatalog.Visible = true;
            labelLoadingCatalog.Visible  = false;
        }
예제 #2
0
        /// <summary>
        /// Loads the "new applications" catalog in the background and displays it.
        /// </summary>
        private async void LoadCatalogAsync()
        {
            buttonRefreshCatalog.Visible = false;
            labelLoadingCatalog.Visible  = true;

            labelLastCatalogError.Visible = false;
            try
            {
                _tileManagement.SetCatalog(await Task.Run(_tileManagement.GetCatalogOnline));
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                labelLastCatalogError.Text    = ex.Message;
                labelLastCatalogError.Visible = true;
            }

            buttonRefreshCatalog.Visible = true;
            labelLoadingCatalog.Visible  = false;
        }