void addFavoritesCmd_Invoked(object sender, EventArgs e) { //this.m_filters //IList<UserFilter> oldFilters = OMLSettings.UserFilters; //UserFilter[] newFilters = new UserFilter[oldFilters.Count + 1]; ////deal with the existing userfilters //for (int i = 0; i < oldFilters.Count; i++) //{ // newFilters[i] = oldFilters[i]; //} OMLEngine.TitleFilter[] newFilter = new OMLEngine.TitleFilter[this.m_filters.Count]; for (int i = 0; i < this.m_filters.Count; i++) { newFilter[i] = this.m_filters[i]; } UserFilter filter = new UserFilter(this.ContentLabel.Replace("|", "").Replace(" OML Home", ""), newFilter); Dictionary <string, object> properties = new Dictionary <string, object>(); Library.Code.V3.FavoritesItemSettings page = new Library.Code.V3.FavoritesItemSettings(filter, true); properties["Page"] = page; properties["Application"] = OMLApplication.Current; OMLApplication.Current.CatchMoreInfo(); OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FavoritesItemSettings", properties); //newFilters[oldFilters.Count] = filter; //OMLSettings.UserFilters = newFilters; }
void addFavoritesCmd_Invoked(object sender, EventArgs e) { //this.m_filters IList <UserFilter> oldFilters = OMLSettings.UserFilters; UserFilter[] newFilters = new UserFilter[oldFilters.Count + 1]; //deal with the existing userfilters for (int i = 0; i < oldFilters.Count; i++) { newFilters[i] = oldFilters[i]; } OMLEngine.TitleFilter[] newFilter = new OMLEngine.TitleFilter[this.m_filters.Count]; for (int i = 0; i < this.m_filters.Count; i++) { newFilter[i] = this.m_filters[i]; } UserFilter filter = new UserFilter(this.Description, newFilter); newFilters[oldFilters.Count] = filter; OMLSettings.UserFilters = newFilters; OMLApplication.Current.CatchMoreInfo(); }
void addFavoritesCmd_Invoked(object sender, EventArgs e) { //this.m_filters //IList<UserFilter> oldFilters = OMLSettings.UserFilters; //UserFilter[] newFilters = new UserFilter[oldFilters.Count + 1]; ////deal with the existing userfilters //for (int i = 0; i < oldFilters.Count; i++) //{ // newFilters[i] = oldFilters[i]; //} OMLEngine.TitleFilter[] newFilter = new OMLEngine.TitleFilter[this.m_filters.Count]; for (int i = 0; i < this.m_filters.Count; i++) { newFilter[i]=this.m_filters[i]; } UserFilter filter = new UserFilter(this.ContentLabel.Replace("|","").Replace(" OML Home",""), newFilter); Dictionary<string, object> properties = new Dictionary<string, object>(); Library.Code.V3.FavoritesItemSettings page = new Library.Code.V3.FavoritesItemSettings(filter, true); properties["Page"] = page; properties["Application"] = OMLApplication.Current; OMLApplication.Current.CatchMoreInfo(); OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FavoritesItemSettings", properties); //newFilters[oldFilters.Count] = filter; //OMLSettings.UserFilters = newFilters; }
void addFavoritesCmd_Invoked(object sender, EventArgs e) { //this.m_filters IList<UserFilter> oldFilters = OMLSettings.UserFilters; UserFilter[] newFilters = new UserFilter[oldFilters.Count + 1]; //deal with the existing userfilters for (int i = 0; i < oldFilters.Count; i++) { newFilters[i] = oldFilters[i]; } OMLEngine.TitleFilter[] newFilter = new OMLEngine.TitleFilter[this.m_filters.Count]; for (int i = 0; i < this.m_filters.Count; i++) { newFilter[i]=this.m_filters[i]; } UserFilter filter = new UserFilter(this.Description, newFilter); newFilters[oldFilters.Count] = filter; OMLSettings.UserFilters = newFilters; OMLApplication.Current.CatchMoreInfo(); }
private void AddComplete(IAsyncResult itfAR) { DvdInfo dvd = DvdInfo.EndGetDvdInfo(itfAR); string imgPath = dvd.LargeCoverUrl; if (!string.IsNullOrEmpty(imgPath) && imgPath.IndexOf("http") != 0 && imgPath.IndexOf("file") != 0) imgPath = string.Format("file://{0}", imgPath); this.DefaultImage = new Image(imgPath); this.SimpleVideoFormat = "DVD"; if (!string.IsNullOrEmpty(dvd.ReleaseDate)) this.MetadataTop = dvd.ReleaseDate; else this.MetadataTop = ""; this.ItemId = 1; //string dvdStarRating = GetNodeInnerText(dvdDoc, "/METADATA/MDR-DVD/title/providerRating");//dvdDoc.SelectSingleNode("/METADATA/MDR-DVD/title/providerRating").InnerText; //if(string.IsNullOrEmpty(dvdStarRating)) // dvdStarRating="0"; ////string starRating = Convert.ToString(Math.Round((Convert.ToDouble(dvdStarRating) * 0.8), MidpointRounding.AwayFromZero)); //this.StarRating = dvdStarRating; string extendedMetadata = string.Empty; this.Metadata = dvd.MPAARating; if (string.IsNullOrEmpty(dvd.MPAARating)) this.Metadata = "Not Rated"; if (!string.IsNullOrEmpty(dvd.Duration)) this.Metadata += string.Format(", {0} minutes", dvd.Duration); this.Tagline = dvd.Synopsis; this.Invoked += delegate(object sender, EventArgs args) { //to test v3 Library.Code.V3.DetailsPage page = new Library.Code.V3.DetailsPage(); //DataRow movieData = this.GetMovieData(movieId); page.Description = "movie details"; page.Title = this.Description; page.Summary = dvd.Synopsis; page.Background = this.DefaultImage; page.Details = new Library.Code.V3.ExtendedDetails(); page.Details.CastArray = new ArrayListDataSet(); if (!string.IsNullOrEmpty(dvd.Director)) { int directorCount = 0; string[] directors = dvd.Director.Replace("; ",";").Split(new char[] { ';' }); foreach (string director in directors) { Library.Code.V3.CastCommand directorCommand = new Library.Code.V3.CastCommand(); directorCommand.Role = " "; directorCommand.Description = director; if (directorCount == 0) { directorCommand.CastType = "TitleAndDesc"; directorCommand.GroupTitle = "DIRECTOR"; directorCommand.ActorId = 1;//not sure how this works in oml } else directorCommand.CastType = "Desc"; page.Details.CastArray.Add(directorCommand); directorCount++; } page.Details.Director = string.Format("Directed By: {0}", dvd.Director); } if (!string.IsNullOrEmpty(dvd.LeadPerformer)) { string[] cast = dvd.LeadPerformer.Replace("; ", ";").Split(new char[] { ';' }); int actorCount = 0; foreach (string actor in cast) { Library.Code.V3.CastCommand actorCommand = new Library.Code.V3.CastCommand(); actorCommand.Description = actor; actorCommand.ActorId = 1;//not sure how this works in oml //actorCommand.Role = kvp.Value;//not sure about role here... if (actorCount == 0) { //add the title "CAST" actorCommand.CastType = "TitleAndDesc"; actorCommand.GroupTitle = "CAST"; } else actorCommand.CastType = "Desc"; page.Details.CastArray.Add(actorCommand); actorCount++; } page.Details.Cast = string.Format("Cast Info: {0}", dvd.LeadPerformer); } //if (this.StarRating != "0") // page.Details.StarRating = new Image(string.Format("resx://Library/Library.Resources/V3_Controls_Common_Stars_{0}", starRating)); //strip invalid dates if (!string.IsNullOrEmpty(dvd.ReleaseDate)) page.Details.YearString = dvd.ReleaseDate; page.Details.Studio = dvd.Studio; page.Details.GenreRatingandRuntime = dvd.Genre; //fixes double spacing issues if(!string.IsNullOrEmpty(dvd.Synopsis)) page.Details.Summary = dvd.Synopsis.Replace("\r\n", "\n"); page.Commands = new ArrayListDataSet(page); //default play command Command playCmd = new Command(); playCmd.Description = "Play"; playCmd.Invoked += new EventHandler(playCmd_Invoked); page.Commands.Add(playCmd); if (page.Details.CastArray.Count > 0) { foreach (Library.Code.V3.CastCommand actor in page.Details.CastArray) { //actor.Invoked += new EventHandler(actor_Invoked); //TitleCollection titles = new TitleCollection(); OMLEngine.TitleFilter personFilter = new OMLEngine.TitleFilter(OMLEngine.TitleFilterType.Person, actor.Description); OMLEngine.TitleCollectionManager.GetFilteredTitles(new List<OMLEngine.TitleFilter>() { personFilter }); } Command command = new Command(); command.Description = "Cast + More"; command.Invoked += delegate(object castSender, EventArgs castArgs) { Dictionary<string, object> castProperties = new Dictionary<string, object>(); castProperties["Page"] = page; castProperties["Application"] = Library.OMLApplication.Current; Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_DetailsPageCastCrew", castProperties); }; page.Commands.Add(command); } Dictionary<string, object> properties = new Dictionary<string, object>(); properties["Page"] = page; properties["Application"] = Library.OMLApplication.Current; Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_DetailsPage", properties); }; }