public async Task<bool> Get(int id) { try { var ar = new GetAlbumList(ListType.alphabeticalByName, size: "10") { appName = "wuffSonic", user = "", password = "", version = "1.11", uri = "http://music.deviouscreation.com" }; var albumsResponse = await ar.DoRequest<GetAlbumListResponse>(); var returnedAlbums = albumsResponse.albumList.album; foreach (var returnedAlbum in returnedAlbums) { long albumId, coverArtId; long.TryParse(returnedAlbum.id, out albumId); long.TryParse(returnedAlbum.artistId, out coverArtId); var album = new Album(albumId, returnedAlbum.name, coverArtId); var albumRequest = new GetAlbum(returnedAlbum.id); var albumResponse = await albumRequest.DoRequest<GetAlbum>(); var songs = albumResponse.Response.album.song; foreach (var song in songs) { var track = new Track(song.id, song.duration, song.size, song.title, song.track) } _musicContext.Albums.Add(album); } } catch (Exception ex) { throw; } return true; }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); // La inn en spritefont i content-prosjektet for å // tegne tekst. Denne vises her. spritefont = Content.Load<SpriteFont>("Arial"); // Opprett egendefinerte spillobjekter car = new Car(Content, "buggy"); track = new Track(device, Content); obstacle = new Obstacle(device, Content); terrain = new Terrain(device, Content); skybox = new Skybox(device, Content, "miramar"); }