// Show when item is entered private void List_ItemActivated(object sender, ItemActivatedArgs args) { movieinfo = new YahooTrailersInfo(); movieinfo.Title = ((YahooTrailersListItem)_trailerlist.SelectedItem).Title.Text; movieinfo.Details = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._details); movieinfo.Starring = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._starring); movieinfo.Genre = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._genre); movieinfo.ReleaseDate = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._releasedate); movieinfo.Rating = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._rating); movieinfo.JPEGURL = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._jpegURL); if (((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL != null) { movieinfo._trailer2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL != null) { movieinfo._trailerURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL != null) { movieinfo._teaser2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL != null) { movieinfo._teaserURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL; } ShowScreen s = new ShowScreen("YahooTrailersDetailsScreen", movieinfo); s.Execute(); return; }
// On entering the screen public override void Activate() { if (base.NavigatingForward) { base.Activate(); // Get all trailers downloaded string[] movList = Directory.GetFiles(homedir + "\\Trailers", "*.mov"); for (int i = 0; i < movList.Length; i++) { int lastIndex = movList[i].LastIndexOf("\\"); movList[i] = movList[i].Substring(lastIndex + 1); } // Get the movie info to display YahooTrailersInfo movieinfo = (YahooTrailersInfo)ScreenArgs; //SnapStream.Logging.WriteLog("YahooTrailers: Loading " + movieinfo.Title.ToString()); _header.Text = movieinfo.Title.ToString(); _details.Text = movieinfo.Details.ToString(); _starring.Text = movieinfo.Starring.ToString(); _genre.Text = movieinfo.Genre.ToString(); _releasedate.Text = movieinfo.ReleaseDate.ToString(); _rating.Text = movieinfo.Rating.ToString(); // Get Poster string jpgpath = homedir + "\\Posters\\" + movieinfo.Title.ToString().Replace(":", "").Replace("?", "") + ".jpg"; ((PosterWindow)_poster).LoadTexture(jpgpath); // Create variable item list of trailers ((BaseList)_trailers).Clear(); // List all the available trailers string movieName = _header.Text; Trailer trailer; // Trailer 2 if (movieinfo._trailer2URL != null) { //SnapStream.Logging.WriteLog("YahooTrailers: Getting Trailer #2 Links"); // 480p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer2@480p", "Trailer 2", "480p"); } else { trailer = new Trailer("Trailer2@480p", "Trailer 2", "480p"); } trailer._movieURL = movieinfo._trailer2URL[0]; trailer.Height = 35; _trailers.AddItem(trailer); // 720p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer2@720p", "Trailer 2", "720p"); } else { trailer = new Trailer("Trailer2@720p", "Trailer 2", "720p"); } trailer._movieURL = movieinfo._trailer2URL[1]; trailer.Height = 35; _trailers.AddItem(trailer); // 1080p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer2@1080p", "Trailer 2", "1080p"); } else { trailer = new Trailer("Trailer2@1080p", "Trailer 2", "1080p"); } trailer._movieURL = movieinfo._trailer2URL[2]; trailer.Height = 35; _trailers.AddItem(trailer); } // Trailer if (movieinfo._trailerURL != null) { //SnapStream.Logging.WriteLog("YahooTrailers: Getting Trailer Links"); // 480p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer@480p", "Trailer", "480p"); } else { trailer = new Trailer("Trailer@480p", "Trailer", "480p"); } trailer._movieURL = movieinfo._trailerURL[0]; trailer.Height = 35; _trailers.AddItem(trailer); // 720p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer@720p", "Trailer", "720p"); } else { trailer = new Trailer("Trailer@720p", "Trailer", "720p"); } trailer._movieURL = movieinfo._trailerURL[1]; trailer.Height = 35; _trailers.AddItem(trailer); // 1080p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Trailer@1080p", "Trailer", "1080p"); } else { trailer = new Trailer("Trailer@1080p", "Trailer", "1080p"); } trailer._movieURL = movieinfo._trailerURL[2]; trailer.Height = 35; _trailers.AddItem(trailer); } // Teaser if (movieinfo._teaser2URL != null) { //SnapStream.Logging.WriteLog("YahooTrailers: Getting Teaser #2 Links"); // 480p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser2@480p", "Teaser 2", "480p"); } else { trailer = new Trailer("Teaser2@480p", "Teaser 2", "480p"); } trailer._movieURL = movieinfo._teaser2URL[0]; trailer.Height = 35; _trailers.AddItem(trailer); // 720p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser2@720p", "Teaser 2", "720p"); } else { trailer = new Trailer("Teaser2@720p", "Teaser 2", "720p"); } trailer._movieURL = movieinfo._teaser2URL[1]; trailer.Height = 35; _trailers.AddItem(trailer); // 1080p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser2@1080p", "Teaser 2", "1080p"); } else { trailer = new Trailer("Teaser2@1080p", "Teaser 2", "1080p"); } trailer._movieURL = movieinfo._teaser2URL[2]; trailer.Height = 35; _trailers.AddItem(trailer); } // Teaser if (movieinfo._teaserURL != null) { //SnapStream.Logging.WriteLog("YahooTrailers: Getting Teaser Links"); // 480p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser@480p", "Teaser", "480p"); } else { trailer = new Trailer("Teaser@480p", "Teaser", "480p"); } trailer._movieURL = movieinfo._teaserURL[0]; trailer.Height = 35; _trailers.AddItem(trailer); // 720p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser@720p", "Teaser", "720p"); } else { trailer = new Trailer("Teaser@720p", "Teaser", "720p"); } trailer._movieURL = movieinfo._teaserURL[1]; trailer.Height = 35; _trailers.AddItem(trailer); // 1080p Link if (isInLibrary(movieName + "*****@*****.**", movList)) { trailer = new Trailer("PLAY Teaser@1080p", "Teaser", "1080p"); } else { trailer = new Trailer("Teaser@1080p", "Teaser", "1080p"); } trailer._movieURL = movieinfo._teaserURL[2]; trailer.Height = 35; _trailers.AddItem(trailer); } return; } }
// Show when item is entered private void List_ItemActivated( object sender, ItemActivatedArgs args ) { movieinfo = new YahooTrailersInfo(); movieinfo.Title = ((YahooTrailersListItem)_trailerlist.SelectedItem).Title.Text; movieinfo.Details = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._details); movieinfo.Starring = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._starring); movieinfo.Genre = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._genre); movieinfo.ReleaseDate = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._releasedate); movieinfo.Rating = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._rating); movieinfo.JPEGURL = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._jpegURL); if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL != null ) movieinfo._trailer2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL != null ) movieinfo._trailerURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL != null ) movieinfo._teaser2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL != null ) movieinfo._teaserURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL; ShowScreen s = new ShowScreen( "YahooTrailersDetailsScreen", movieinfo ); s.Execute(); return; }