BeatMachine.Model.DataModel.LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted C# (CSharp) Метод

LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted() публичный Метод

public LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
Результат void
        void LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted(
            object sender, EchoNestApiEventArgs e)
        {
            if (e.Error == null)
            {
                Catalog cat = (Catalog)e.GetResultData();

                // TODO If isolated storage fails here, then the next time they
                // run the app, we will create another catalog. We need to handle
                // this somehow - perhaps use the unique device ID (which is bad
                // practice apparently) as the catalog name to make sure there is
                // only one catalog created per device ever.

                logger.Debug("Creating remote CatalogID completed successfully");

                SafeIsolatedStorageSettings settings = new SafeIsolatedStorageSettings();
                settings[CatalogIdPropertyName] = cat.Id;
                settings.Save();

                CatalogId = cat.Id;

                logger.Info("Completed LoadCatalogId");

            }
            else
            {
                logger.Error("Creating remote CatalogID failed, retrying");
                LoadCatalogIdNeedsToRunAgain();
            }
        }