Example #1
0
        /// <summary>
        /// Launches Nokia Music App to show information on a selected product.
        /// </summary>
        /// <param name="id">Id of the product.</param>
        public void LaunchProduct(string id)
        {
            if (!initialized)
            {
                return;
            }

            ShowProductTask task = new ShowProductTask();
            task.ProductId = id;
            task.Show();
        }
Example #2
0
 /// <summary>
 /// Launches Nokia MixRadio to show details about the product using the ShowProductTask
 /// </summary>
 public void Show()
 {
     ShowProductTask task = new ShowProductTask() { ProductId = this.Id };
     task.Show();
 }
Example #3
0
        /// <summary>
        /// Routes clicks on an MusicItem to the right place...
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="player">The player if the page has one.</param>
        /// <returns>
        /// A boolean indicating if we rooted the object successfully
        /// </returns>
        public bool RouteItemClick(object item, MediaElement player)
        {
            Artist artist = item as Artist;
            if (artist != null)
            {
                App.RootFrame.Navigate(typeof(DetailPage), artist);
                return true;
            }

            Product product = item as Product;
            if (product != null)
            {
                if (product.Category == Category.Track)
                {
                    Debug.WriteLine("Track pressed");
                    ShowProductTask task = new ShowProductTask() { ProductId = product.Id };
                    task.Show();
                }
                else if (product.Category == Category.Album)
                {
                    App.RootFrame.Navigate(typeof(DetailPage), product);
                }

                return true;
            }

            Genre genre = item as Genre;
            if (genre != null)
            {
                App.RootFrame.Navigate(typeof(DetailPage), genre);
                return true;
            }

            MixGroup group = item as MixGroup;
            if (group != null)
            {
                App.RootFrame.Navigate(typeof(ShowListPage), new ShowListParams(MethodCall.GetMixes, group.Id, group.Name));
                return true;
            }

            Mix mix = item as Mix;
            if (mix != null)
            {
                mix.Play();
                return true;
            }

            return false;
        }
 /// <summary>
 /// Launches Nokia MixRadio app to an album view.
 /// </summary>
 /// <param name="sender">"Show in Nokia MixRadio" button</param>
 /// <param name="e">Event arguments</param>
 private void ShowProduct(object sender, RoutedEventArgs e)
 {
     ShowProductTask task = new ShowProductTask();
     task.ProductId = this._albumId;
     task.Show();
 }
Example #5
0
        /// <summary>
        /// Routes clicks on an MusicItem to the right place...
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>A boolean indicating if we rooted the object successfully</returns>
        public bool RouteItemClick(object item)
        {
            Artist artist = item as Artist;
            if (artist != null)
            {
                string thumb = string.Empty;
                if (artist.Thumb200Uri != null)
                {
                    thumb = HttpUtility.UrlEncode(artist.Thumb200Uri.ToString());
                }

                this.RootFrame.Navigate(new Uri("/ArtistPage.xaml?" + App.IdParam + "=" + artist.Id + "&" + App.NameParam + "=" + HttpUtility.UrlEncode(artist.Name) + "&" + App.ThumbParam + "=" + thumb, UriKind.Relative));
                return true;
            }

            Product product = item as Product;
            if (product != null)
            {
                if (product.Category == Category.Track)
                {
                    ShowProductTask task = new ShowProductTask() { ProductId = product.Id };
                    task.Show();
                }
                else
                {
                    string thumb = string.Empty;
                    if (product.Thumb200Uri != null)
                    {
                        thumb = HttpUtility.UrlEncode(product.Thumb200Uri.ToString());
                    }

                    this.RootFrame.Navigate(new Uri("/AlbumPage.xaml?" + App.IdParam + "=" + product.Id + "&" + App.NameParam + "=" + HttpUtility.UrlEncode(product.Name) + "&" + App.ThumbParam + "=" + thumb, UriKind.Relative));
                }

                return true;
            }

            Genre genre = item as Genre;
            if (genre != null)
            {
                this.RootFrame.Navigate(new Uri("/GenrePage.xaml?" + IdParam + "=" + genre.Id + "&" + App.NameParam + "=" + HttpUtility.UrlEncode(genre.Name), UriKind.Relative));
                return true;
            }

            MixGroup group = item as MixGroup;
            if (group != null)
            {
                this.RootFrame.Navigate(new Uri("/ShowListPage.xaml?" + ShowListPage.MethodParam + "=" + MethodCall.GetMixes + "&" + IdParam + "=" + group.Id + "&" + NameParam + "=" + HttpUtility.UrlEncode(group.Name), UriKind.Relative));
                return true;
            }

            Mix mix = item as Mix;
            if (mix != null)
            {
                PlayMixTask mixPlayer = new PlayMixTask() { MixId = mix.Id };
                mixPlayer.Show();
                return true;
            }

            return false;
        }
 public void TestShowProductGoesAheadWhenItCan()
 {
     ShowProductTask task = new ShowProductTask() { AppId = TestAppId, ProductId = TestProductId };
     task.Show();            
     Assert.Pass();
 }
 public void TestProductIdPropertyIsRequiredForShow()
 {
     ShowProductTask task = new ShowProductTask();
     task.Show();
 }
 public void TestProductIdPropertyPersists()
 {
     ShowProductTask task = new ShowProductTask() { ProductId = TestProductId };
     Assert.AreEqual(TestProductId, task.ProductId, "Expected the same ID");
 }