private void SafeUpdateOptions(object oSelectedBlueprint) { if (!Microsoft.MediaCenter.UI.Application.IsApplicationThread) { Microsoft.MediaCenter.UI.Application.DeferredInvoke(new Microsoft.MediaCenter.UI.DeferredHandler(this.SafeUpdateOptions), oSelectedBlueprint); } else { SlideBlueprint other = (SlideBlueprint)oSelectedBlueprint; List <SlideBlueprint> list = new List <SlideBlueprint>(); for (int i = 0; i < this._blueprint.Slides.Count; i++) { SlideBlueprint item = this._blueprint.Slides[i]; if (item.Insertion == SlideInsertion.Add) { list.Add(item); } } if (other.Insertion == SlideInsertion.Remove) { if (this._blueprint.DefaultSlide.Equals(other)) { other = list[0]; } else { other = this._blueprint.DefaultSlide; } } base.Options = list; base.Chosen = other; } }
public SlideDeckBlueprint(SlideBlueprint defaultSlide, string uiName, DateTime startDate, DateTime endDate, SlideDeckBlueprint baseBlueprint, params SlideBlueprint[] slides) { if (slides == null) { throw new ArgumentNullException("slides"); } List <SlideBlueprint> list = new List <SlideBlueprint>(); SlideBlueprint blueprint = defaultSlide; if (baseBlueprint != null) { if (blueprint == null) { blueprint = baseBlueprint.DefaultSlide; } list.AddRange(baseBlueprint.Slides); foreach (SlideBlueprint blueprint2 in slides) { if (blueprint2 != null) { if (blueprint2.Insertion == SlideInsertion.Add) { int index = list.IndexOf(blueprint2); if (-1 < index) { list[index] = blueprint2; } else { list.Add(blueprint2); } } else if (blueprint2.Insertion == SlideInsertion.Remove) { int num2 = list.IndexOf(blueprint2); if (-1 < num2) { list.RemoveAt(num2); } } } } this._slides = new ReadOnlyCollection <SlideBlueprint>(list); } else { this._slides = new ReadOnlyCollection <SlideBlueprint>(slides); } this._defaultSlide = blueprint; this._uiName = uiName; this._startDate = startDate; this._endDate = endDate; }
private void EnableOrDisableSlide(string title, SlideInsertion insertion) { int num = -1; int num2 = 0; int num3 = -1; SlideBlueprint chosen = base.Chosen as SlideBlueprint; if ((this._blueprint != null) && (this._blueprint.Slides != null)) { for (int i = 0; i < this._blueprint.Slides.Count; i++) { SlideBlueprint other = this._blueprint.Slides[i]; if (other != null) { if (string.Compare(other.Title, title, StringComparison.OrdinalIgnoreCase) == 0) { if (other.Insertion == insertion) { return; } num = i; } if (other.Insertion == SlideInsertion.Add) { if (-1 == num3) { num3 = i; } if ((chosen == null) && other.Equals(this._blueprint.DefaultSlide)) { chosen = other; } num2++; } else if ((chosen != null) && chosen.Equals(other)) { chosen = null; } } } if ((-1 != num) && ((insertion != SlideInsertion.Remove) || (1 != num2))) { this._blueprint.Slides[num].Insertion = insertion; if (chosen == null) { chosen = this._blueprint.Slides[num3]; } this.SafeUpdateOptions(chosen); } } }
public SlideDeckBlueprint Clone() { SlideDeckBlueprint blueprint = new SlideDeckBlueprint { _defaultSlide = this._defaultSlide, _uiName = this._uiName, _startDate = this._startDate, _endDate = this._endDate }; SlideBlueprint[] list = new SlideBlueprint[this._slides.Count]; for (int i = 0; i < list.Length; i++) { if (this._slides[i] == null) { throw new InvalidOperationException("null slide encountered during Clone"); } list[i] = this._slides[i].Clone(); } blueprint._slides = new ReadOnlyCollection <SlideBlueprint>(list); return(blueprint); }
private void LoadXmlSource(string source, bool clear) { try { XmlDocument document = new XmlDocument(); XmlNamespaceManager nsmgr = new XmlNamespaceManager(document.NameTable); nsmgr.AddNamespace("m", "http://schemas.microsoft.com/2007/MceMarkupContextTree"); Resource resource = ResourceManager.Instance.GetResource("res://ehres!MceMarkupContextTree.xsd"); if (resource.Open() != ResourceStatus.Available) { try { resource.Close(); this.LastException = new NotImplementedException("res://ehres!MceMarkupContextTree.xsd could not be opened"); } catch (Exception exception) { this.LastException = exception; } this.Denial = new Denial("res://ehres!TODO_DENIAL_INVALID_CONTEXT.mcml", 100); } else { XmlReaderSettings settings = new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true }; settings.Schemas.Add(XmlSchema.Read(resource.Stream, null)); settings.ValidationType = ValidationType.Schema; settings.ConformanceLevel = ConformanceLevel.Document; settings.ValidationEventHandler += new ValidationEventHandler(this.OnXmlValidation); resource.Close(); Resource resource2 = ResourceManager.Instance.GetResource(source); if (resource2.Open() != ResourceStatus.Available) { this.LastException = null; try { resource2.Close(); this.LastException = new NotImplementedException(source + " could not be opened"); } catch (Exception exception2) { this.LastException = exception2; } this._denial = new Denial("res://ehres!TODO_DENIAL_INVALID_CONTEXT.mcml", 100); } else { XmlReader reader = XmlReader.Create(resource2.Stream, settings); document.Load(reader); reader.Close(); resource2.Close(); if (clear) { this.Clear(); } Queue <KeyValuePair <string, XmlNode> > queue = new Queue <KeyValuePair <string, XmlNode> >(); foreach (XmlNode node in document.DocumentElement.SelectNodes("m:Node", nsmgr)) { queue.Enqueue(new KeyValuePair <string, XmlNode>(node.Attributes["Name"].Value, node)); } Dictionary <string, SlideBlueprint> dictionary = new Dictionary <string, SlideBlueprint>(); Queue <KeyValuePair <string, XmlNode> > queue2 = new Queue <KeyValuePair <string, XmlNode> >(); while (0 < queue.Count) { KeyValuePair <string, XmlNode> pair = queue.Dequeue(); string key = pair.Key; XmlNode node2 = pair.Value; foreach (XmlNode node3 in node2.SelectNodes("m:Node", nsmgr)) { queue.Enqueue(new KeyValuePair <string, XmlNode>(key + "/" + node3.Attributes["Name"].Value, node3)); } XmlNode node4 = node2.SelectSingleNode("m:SlideDeck", nsmgr); if (node4 != null) { queue2.Enqueue(new KeyValuePair <string, XmlNode>(key, node4)); } } int num = 0; while (0 < queue2.Count) { if (num == queue2.Count) { this.LastException = new ArgumentException("Unresolvable (circular) reference while processing SlideDeck blueprints"); this.Denial = new Denial("res://ehres!TODO_DENIAL_INVALID_XML.mcml", 100); return; } KeyValuePair <string, XmlNode> item = queue2.Dequeue(); string str2 = item.Key; XmlNode node5 = item.Value; SlideDeckBlueprint blueprint = null; if ((node5.Attributes["Base"] != null) && (!this.TryGetValue(node5.Attributes["Base"].Value, out blueprint) || (blueprint == null))) { num++; queue2.Enqueue(item); } else { List <SlideBlueprint> list = new List <SlideBlueprint>(); foreach (XmlNode node6 in node5.SelectSingleNode("m:Slides", nsmgr).ChildNodes) { SlideInsertion insertion = (SlideInsertion)Enum.Parse(typeof(SlideInsertion), node6.Name); SlideBlueprint blueprint2 = new SlideBlueprint(this.GetXmlAttribute(node6, "UIName"), this.GetXmlAttribute(node6, "Title"), this.GetXmlAttribute(node6, "StartDate", DateTime.MinValue), this.GetXmlAttribute(node6, "EndDate", DateTime.MaxValue), insertion); list.Add(blueprint2); if (!dictionary.ContainsKey(blueprint2.UIName)) { dictionary.Add(blueprint2.UIName, blueprint2); } } SlideDeckBlueprint blueprint3 = new SlideDeckBlueprint(dictionary[this.GetXmlAttribute(node5, "DefaultSlide")], this.GetXmlAttribute(node5, "UIName"), this.GetXmlAttribute(node5, "StartDate", DateTime.MinValue), this.GetXmlAttribute(node5, "EndDate", DateTime.MaxValue), blueprint, list.ToArray()); this.Add(str2, blueprint3); num = 0; } } } } } catch (Exception exception3) { this.LastException = exception3; this.Denial = new Denial("res://ehres!TODO_DENIAL_LOAD_ERROR.mcml", 100); } }
public SlideDeckBlueprint(SlideBlueprint defaultSlide, string uiName, DateTime startDate, DateTime endDate, params SlideBlueprint[] slides) : this(defaultSlide, uiName, startDate, endDate, null, slides) { }
//gotta remove this-fired only from actor invoke on movieitem public GalleryPage(System.Collections.Generic.IEnumerable<OMLEngine.Title> _titles, string galleryName) : this() { #region v3POC //SetPrimaryBackgroundImage(); //OMLEngine.TitleCollection _titles = new OMLEngine.TitleCollection(); //_titles.loadTitleCollection(); //primaryBackgroundImage //this is temp to test controls OMLProperties properties = new OMLProperties(); properties.Add("Application", OMLApplication.Current); //properties.Add("UISettings", new UISettings()); //properties.Add("Settings", new Library.Settings()); properties.Add("I18n", I18n.Instance); //v3 main gallery Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(); //description gallery.Description = galleryName; //size of the galleryitems //DEPRECATED //gallery.ItemSize = Library.Code.V3.GalleryItemSize.Small; gallery.Model = new Library.Code.V3.BrowseModel(gallery); //commands at top of screen gallery.Model.Commands = new ArrayListDataSet(gallery); //create the context menu //Library.Code.V3.ContextMenuData ctx = new Library.Code.V3.ContextMenuData(); //create the settings cmd Library.Code.V3.ThumbnailCommand settingsCmd = new Library.Code.V3.ThumbnailCommand(gallery); settingsCmd.Description = "settings"; settingsCmd.DefaultImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_BrowseCmd_Settings"); settingsCmd.DormantImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_BrowseCmd_Settings_Dormant"); settingsCmd.FocusImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_BrowseCmd_Settings_Focus"); //no invoke for now //settingsCmd.Invoked += new EventHandler(settingsCmd_Invoked); gallery.Model.Commands.Add(settingsCmd); //create the Search cmd Library.Code.V3.ThumbnailCommand searchCmd = new Library.Code.V3.ThumbnailCommand(gallery); searchCmd.Description = "search"; searchCmd.DefaultImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Search"); searchCmd.DormantImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Search_Dormant"); searchCmd.FocusImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Search_Focus"); //searchCmd.Invoked += new EventHandler(searchCmd_Invoked); gallery.Model.Commands.Add(searchCmd); ////some ctx items //Library.Code.V3.ThumbnailCommand viewListCmd = new Library.Code.V3.ThumbnailCommand(gallery); //viewListCmd.Description = "View List"; ////viewListCmd.Invoked += new EventHandler(viewCmd_Invoked); //Library.Code.V3.ThumbnailCommand viewSmallCmd = new Library.Code.V3.ThumbnailCommand(gallery); ////viewSmallCmd.Invoked += new EventHandler(viewCmd_Invoked); //viewSmallCmd.Description = "View Small"; //Library.Code.V3.ThumbnailCommand viewLargeCmd = new Library.Code.V3.ThumbnailCommand(gallery); ////viewLargeCmd.Invoked += new EventHandler(viewCmd_Invoked); //viewLargeCmd.Description = "View Large"; //Library.Code.V3.ThumbnailCommand viewSettingsCmd = new Library.Code.V3.ThumbnailCommand(gallery); ////viewSettingsCmd.Invoked += new EventHandler(this.SettingsHandler); //viewSettingsCmd.Description = "Settings"; ////ctx.SharedItems.Add(viewLargeCmd); //ctx.SharedItems.Add(viewSmallCmd); //ctx.SharedItems.Add(viewListCmd); //ctx.SharedItems.Add(viewSettingsCmd); //Library.Code.V3.ThumbnailCommand viewMovieDetailsCmd = new Library.Code.V3.ThumbnailCommand(gallery); //viewMovieDetailsCmd.Description = "Movie Details"; //Library.Code.V3.ThumbnailCommand viewPlayCmd = new Library.Code.V3.ThumbnailCommand(gallery); //viewPlayCmd.Description = "Play"; //Library.Code.V3.ThumbnailCommand viewDeleteCmd = new Library.Code.V3.ThumbnailCommand(gallery); //viewDeleteCmd.Description = "Delete"; //ctx.UniqueItems.Add(viewMovieDetailsCmd); //ctx.UniqueItems.Add(viewPlayCmd); //ctx.UniqueItems.Add(viewDeleteCmd); Command CommandContextPopOverlay = new Command(); properties.Add("CommandContextPopOverlay", CommandContextPopOverlay); //properties.Add("MenuData", ctx); //gallery.ContextMenu = ctx; //the pivots gallery.Model.Pivots = new Choice(gallery, "desc", new ArrayListDataSet(gallery)); //twoRowChangerData //#region oneRowChangerData //if (this.mediaChangers != null && this.mediaChangers.KnownDiscs.Count > 0) //{ // VirtualList changerGalleryList = new VirtualList(gallery, null); // foreach (Library.Code.V3.DiscDataEx t in this.mediaChangers.KnownDiscs) // { // //galleryList.Add(this.CreateGalleryItem(t)); // if (t.DiscType == DiscType.MovieDvd) // changerGalleryList.Add(new Library.Code.V3.DVDChangerItem(t, changerGalleryList)); // } // Library.Code.V3.BrowsePivot changerPivot = new Library.Code.V3.BrowsePivot(gallery, "changer", "loading titles...", changerGalleryList); // changerPivot.ContentLabel = "OML"; // changerPivot.SupportsJIL = true; // changerPivot.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; // changerPivot.ContentItemTemplate = "oneRowGalleryItemPoster"; // changerPivot.DetailTemplate = Library.Code.V3.BrowsePivot.ExtendedDetailTemplate; // gallery.Model.Pivots.Options.Add(changerPivot); //} //#endregion oneRowChangerData //twoRowGalleryItemPoster #region oneRowGalleryItemPoster VirtualList galleryList = new VirtualList(gallery, null); foreach (OMLEngine.Title t in _titles) { //galleryList.Add(this.CreateGalleryItem(t)); galleryList.Add(new Library.Code.V3.MovieItem(t, galleryList)); } Library.Code.V3.BrowsePivot p = new Library.Code.V3.BrowsePivot(gallery, "one row", "loading titles...", galleryList); p.ContentLabel = galleryName; p.SupportsJIL = true; p.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; p.ContentItemTemplate = "oneRowGalleryItemPoster"; p.DetailTemplate = Library.Code.V3.BrowsePivot.ExtendedDetailTemplate; gallery.Model.Pivots.Options.Add(p); #endregion oneRowGalleryItemPoster ////twoRowGalleryItemPoster //#region twoRowGalleryItemPoster //VirtualList galleryListGenres = new VirtualList(gallery, null); //foreach (OMLEngine.Title t in _titles) //{ // galleryListGenres.Add(new Library.Code.V3.MovieItem(t, galleryListGenres)); //} //Library.Code.V3.BrowsePivot p2 = new Library.Code.V3.BrowsePivot(gallery, "two row", "loading genres...", galleryListGenres); //p2.ContentLabel = galleryName; //p2.SupportsJIL = true; //p2.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; //p2.ContentItemTemplate = "twoRowGalleryItemPoster"; //p2.DetailTemplate = Library.Code.V3.BrowsePivot.StandardDetailTemplate; //gallery.Model.Pivots.Options.Add(p2); //#endregion twoRowGalleryItemPoster ////ListViewItem //#region ListViewItem //VirtualList galleryListListViewItem = new VirtualList(gallery, null); //foreach (OMLEngine.Title t in _titles) //{ // galleryListListViewItem.Add(new Library.Code.V3.MovieItem(t, galleryListListViewItem)); //} //Library.Code.V3.BrowsePivot p3 = new Library.Code.V3.BrowsePivot(gallery, "list", "loading genres...", galleryListListViewItem); //p3.ContentLabel = galleryName; //p3.SupportsJIL = true; //p3.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; //p3.ContentItemTemplate = "ListViewItem"; //p3.DetailTemplate = Library.Code.V3.BrowsePivot.StandardDetailTemplate; //gallery.Model.Pivots.Options.Add(p3); //#endregion ListViewItem ////Grouped //#region Grouped //VirtualList groupedGalleryListListViewItem = new VirtualList(gallery, null); //int i = 1; //foreach (OMLEngine.Title t in _titles) //{ // i++; // groupedGalleryListListViewItem.Add(new Library.Code.V3.MovieItem(t, groupedGalleryListListViewItem)); // if (i > 20) // break; //} //Library.Code.V3.GalleryItem testtgenre = new Library.Code.V3.GalleryItem(); //testtgenre.Description = "Comedy"; //testtgenre.Metadata = "12 titles"; //testtgenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_comedy"); ////groupedGalleryListListViewItem.Add(testtgenre); //Library.Code.V3.BrowseGroup testGroup = new Library.Code.V3.BrowseGroup();//this, "Sample Group", groupedGalleryListListViewItem); //testGroup.Owner = gallery; //testGroup.Description = "Group 1"; //testGroup.Metadata = "12 titles"; //testGroup.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_mystery"); //testGroup.Content = groupedGalleryListListViewItem; //testGroup.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate; //VirtualList groupListView = new VirtualList(gallery, null); ////groupListView.Add(testtgenre); //groupListView.Add(testGroup); //VirtualList groupedGalleryListListViewItem2 = new VirtualList(gallery, null); //foreach (OMLEngine.Title t in _titles) //{ // i++; // groupedGalleryListListViewItem2.Add(new Library.Code.V3.MovieItem(t, groupedGalleryListListViewItem2)); // if (i > 50) // break; //} //Library.Code.V3.BrowseGroup testGroup2 = new Library.Code.V3.BrowseGroup();//this, "Sample Group", groupedGalleryListListViewItem); //testGroup2.Owner = gallery; //testGroup2.Description = "Group 2"; //testGroup2.Metadata = "12 titles"; //testGroup2.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_mystery"); //testGroup2.Content = groupedGalleryListListViewItem2; //testGroup2.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate; //groupListView.Add(testGroup2); //Library.Code.V3.BrowsePivot group1 = new Library.Code.V3.BrowsePivot(gallery, "group", "grouped...", groupListView); //group1.ContentLabel = galleryName; //group1.SupportsJIL = false; //group1.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; //group1.ContentItemTemplate = "GalleryGroup"; //group1.DetailTemplate = Library.Code.V3.BrowsePivot.StandardDetailTemplate; //gallery.Model.Pivots.Options.Add(group1); //#endregion grouped ////Genres test //#region Genres //VirtualList galleryListthreeRowGalleryItemPoster = new VirtualList(gallery, null); //Library.Code.V3.GalleryItem actionAdventureGenre = new Library.Code.V3.GalleryItem(); //actionAdventureGenre.Description = "Action/Adventure"; //actionAdventureGenre.Metadata = "12 titles"; //actionAdventureGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_actionadventure"); //galleryListthreeRowGalleryItemPoster.Add(actionAdventureGenre); //Library.Code.V3.GalleryItem comedyGenre = new Library.Code.V3.GalleryItem(); //comedyGenre.Description = "Comedy"; //comedyGenre.Metadata = "12 titles"; //comedyGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_comedy"); //galleryListthreeRowGalleryItemPoster.Add(comedyGenre); //Library.Code.V3.GalleryItem documentaryGenre = new Library.Code.V3.GalleryItem(); //documentaryGenre.Description = "Documentary"; //documentaryGenre.Metadata = "12 titles"; //documentaryGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_documentary"); //galleryListthreeRowGalleryItemPoster.Add(documentaryGenre); //Library.Code.V3.GalleryItem dramaGenre = new Library.Code.V3.GalleryItem(); //dramaGenre.Description = "Drama"; //dramaGenre.Metadata = "12 titles"; //dramaGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_drama"); //galleryListthreeRowGalleryItemPoster.Add(dramaGenre); //Library.Code.V3.GalleryItem kidsFamilyGenre = new Library.Code.V3.GalleryItem(); //kidsFamilyGenre.Description = "Kids/Family"; //kidsFamilyGenre.Metadata = "12 titles"; //kidsFamilyGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_kidsfamily"); //galleryListthreeRowGalleryItemPoster.Add(kidsFamilyGenre); //Library.Code.V3.GalleryItem musicalGenre = new Library.Code.V3.GalleryItem(); //musicalGenre.Description = "Musical"; //musicalGenre.Metadata = "12 titles"; //musicalGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_musical"); //galleryListthreeRowGalleryItemPoster.Add(musicalGenre); //Library.Code.V3.GalleryItem mysteryGenre = new Library.Code.V3.GalleryItem(); //mysteryGenre.Description = "Mystery"; //mysteryGenre.Metadata = "12 titles"; //mysteryGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_mystery"); //galleryListthreeRowGalleryItemPoster.Add(mysteryGenre); //Library.Code.V3.GalleryItem otherGenre = new Library.Code.V3.GalleryItem(); //otherGenre.Description = "Other"; //otherGenre.Metadata = "12 titles"; //otherGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_other"); //galleryListthreeRowGalleryItemPoster.Add(otherGenre); //Library.Code.V3.GalleryItem romanceGenre = new Library.Code.V3.GalleryItem(); //romanceGenre.Description = "Romance"; //romanceGenre.Metadata = "12 titles"; //romanceGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_romance"); //galleryListthreeRowGalleryItemPoster.Add(romanceGenre); //Library.Code.V3.GalleryItem scienceFictionGenre = new Library.Code.V3.GalleryItem(); //scienceFictionGenre.Description = "Science Fiction"; //scienceFictionGenre.Metadata = "12 titles"; //scienceFictionGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_sciencefiction"); //galleryListthreeRowGalleryItemPoster.Add(scienceFictionGenre); //Library.Code.V3.GalleryItem westernGenre = new Library.Code.V3.GalleryItem(); //westernGenre.Description = "Western"; //westernGenre.Metadata = "12 titles"; //westernGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_western"); //galleryListthreeRowGalleryItemPoster.Add(westernGenre); //Library.Code.V3.GalleryItem noimageGenre = new Library.Code.V3.GalleryItem(); //noimageGenre.Description = "No Image ergeg ergege egegeg"; //noimageGenre.Metadata = "12 titles"; //noimageGenre.DefaultImage = new Image("resx://Library/Library.Resources/Genre_Sample_noimagegenre"); //galleryListthreeRowGalleryItemPoster.Add(noimageGenre); ////foreach (Title t in _titles) ////{ //// galleryListthreeRowGalleryItemPoster.Add(this.CreateGalleryItem(t)); ////} //Library.Code.V3.BrowsePivot p4 = new Library.Code.V3.BrowsePivot(gallery, "genres", "loading genres...", galleryListthreeRowGalleryItemPoster); //p4.ContentLabel = galleryName; //p4.SupportsJIL = true; //p4.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; //p4.ContentItemTemplate = "twoRowGalleryItemGenre"; //p4.DetailTemplate = Library.Code.V3.BrowsePivot.StandardDetailTemplate; //gallery.Model.Pivots.Options.Add(p4); //#endregion Genres // add OML filters //System.Collections.Specialized.StringCollection filtersToShow = // Properties.Settings.Default.MainFiltersToShow; //foreach (string filterName in filtersToShow) //{ // OMLEngine.TitleFilterType filterType = Filter.FilterStringToTitleType(filterName); // Filter f = new Filter(null, filterType, null);//new MovieGallery() // if (Filter.ShowFilterType(filterType)) // { // ////IEnumerable<Title> titles = TitleCollectionManager.GetAllTitles(); // //IEnumerable<Title> titles; // //if (filterType == TitleFilterType.DateAdded || filterType == TitleFilterType.VideoFormat) // //{ // // titles = TitleCollectionManager.GetAllTitles(); // //} // //else // //{ // // titles = TitleCollectionManager.GetFilteredTitles(filterType, filterName); // //} // //VirtualList filteredGalleryList = new VirtualList(gallery, null); // //foreach (Title t in titles) // //{ // // //galleryList.Add(this.CreateGalleryItem(t)); // // filteredGalleryList.Add(new Library.Code.V3.MovieItem(t, filteredGalleryList)); // //} // VirtualList filteredGalleryList = new VirtualList(gallery, null); // System.Collections.Generic.IList<Library.GalleryItem> filteredTitles = f.GetGalleryItems(); // foreach (Library.GalleryItem item in filteredTitles) // { // filteredGalleryList.Add(new Library.Code.V3.MovieItem(item, filteredGalleryList)); // } // Library.Code.V3.BrowsePivot filteredPivot = new Library.Code.V3.BrowsePivot(gallery, Filter.FilterTypeToString(filterType).ToLower(), "loading titles...", filteredGalleryList); // filteredPivot.ContentLabel = "OML"; // filteredPivot.SupportsJIL = true; // filteredPivot.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery"; // filteredPivot.ContentItemTemplate = "ListViewItem"; // filteredPivot.DetailTemplate = Library.Code.V3.BrowsePivot.ExtendedDetailTemplate; // gallery.Model.Pivots.Options.Add(filteredPivot); // } //} //end add OML filters //properties.Add("Gallery", new GalleryV2(properties, _titles)); properties.Add("Page", gallery); Library.Code.V3.MovieDetailsSlideDeck deck = new Library.Code.V3.MovieDetailsSlideDeck(); //Choice c = new Choice(); VirtualList Options = new VirtualList(); Library.Code.V3.SlideBlueprint bp = new Library.Code.V3.SlideBlueprint(@"resx://Library/Library.Resources/V3_Slide_Movie_Details_Synopsis", "Synopsis", DateTime.MinValue, DateTime.Now); Library.Code.V3.SlideBlueprint bp2 = new Library.Code.V3.SlideBlueprint(@"resx://Library/Library.Resources/V3_Slide_Movie_Details_Actions", "Actions", DateTime.MinValue, DateTime.Now); Options.Add(bp); Options.Add(bp2); deck.Options = Options; deck.Commands = new ArrayListDataSet(); //dummy up some cmds Library.Code.V3.ThumbnailCommand deleteCmd = new Library.Code.V3.ThumbnailCommand(deck); deleteCmd.Description = "Delete"; deleteCmd.DefaultImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Remove"); deleteCmd.DormantImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Remove_Dormant"); deleteCmd.FocusImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Remove_Focus"); deck.Commands.Add(deleteCmd); Library.Code.V3.ThumbnailCommand playCmd = new Library.Code.V3.ThumbnailCommand(deck); playCmd.Description = "Play"; playCmd.DefaultImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Play"); playCmd.DormantImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Play_Dormant"); playCmd.FocusImage = new Image("resx://Library/Library.Resources/V3_Controls_Common_Browse_Cmd_Play_Focus"); deck.Commands.Add(playCmd); deck.Description = "descrip"; deck.Synopsis = "this is a syn adfge rh rhyr yhyr hr hr ge ge gtwt rgwe tgew gr ewg weg ewg wetg wrt g rhtytjuhytgfr er gtwrt her etju ktjy hgt efr erfgetw"; deck.AdditionalCommands = new ArrayListDataSet(); deck.CommandPopOverlay = new Command(); //deck.CommandPopOverlay.Invoked += new EventHandler(CommandPopOverlay_Invoked); deck.CommandClearOverlays = new Command(); //deck.CommandClearOverlays.Invoked += new EventHandler(CommandClearOverlays_Invoked); deck.CommandPushOverlay = new Command(); //deck.CommandPushOverlay.Invoked += new EventHandler(CommandPushOverlay_Invoked); //deck.AdditionalCommands.Add(cmd); properties.Add("SlideDeck", deck); properties.Add("CommandPopOverlay", deck.CommandPopOverlay); properties.Add("CommandClearOverlays", deck.CommandClearOverlays); properties.Add("CommandPushOverlay", deck.CommandPushOverlay); deck.Context = "hi"; //_session.GoToPage(@"resx://Library/Library.Resources/V3_SlideDeck_Movie_Details", properties); //gallery.Model.Pivots.Chosen = p2; //gallery.Model.Pivots.ChosenChanged += new EventHandler(Pivots_ChosenChanged); OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties); //_page = gallery; //_deck = deck; #endregion v3POC }