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();
}
}