Beispiel #1
0
        public GenreItem(Library.GalleryItem title, IModelItem owner, List<TitleFilter> filter)
            : base(owner)
        {
            this.Description = title.Name;
            this.DefaultImage=title.MenuCoverArt;
            this.Metadata = string.Format("{0} titles", title.ForcedCount);
            this.Invoked += delegate(object sender, EventArgs args)
            {
                //am I being silly here copying this?
                List<TitleFilter> newFilter = new List<TitleFilter>();
                foreach (TitleFilter filt in filter)
                {
                    newFilter.Add(filt);
                }
                newFilter.Add(new TitleFilter(title.Category.FilterType, title.Name));
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                properties.Add("I18n", I18n.Instance);
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, title.Description);

                properties.Add("Page", gallery);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #2
0
        public FilterItem(Library.GalleryItem title, IModelItem owner, List <TitleFilter> filter)
            : base(owner)
        {
            this.Description = title.Caption;

            this.Invoked += delegate(object sender, EventArgs args)
            {
                //am I being silly here copying this?
                List <TitleFilter> newFilter = new List <TitleFilter>();
                foreach (TitleFilter filt in filter)
                {
                    newFilter.Add(filt);
                }
                newFilter.Add(new TitleFilter(title.Category.FilterType, title.Name));
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                properties.Add("I18n", I18n.Instance);
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, title.Description);

                properties.Add("Page", gallery);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #3
0
        private void loadBackground(object options)
        {
            foreach (FilteredTitleCollection dateAdded in TitleCollectionManager.GetAllDateAddedGrouped(m_filters))
            {
                Library.Code.V3.YearBrowseGroup testGroup2 = new Library.Code.V3.YearBrowseGroup(new List <Title>(dateAdded.Titles));

                testGroup2.Owner        = this;
                testGroup2.Description  = dateAdded.Name;
                testGroup2.DefaultImage = null;// new Image("resx://Library/Library.Resources/Genre_Sample_mystery");
                testGroup2.Invoked     += delegate(object sender, EventArgs args)
                {
                    OMLProperties properties = new OMLProperties();
                    properties.Add("Application", OMLApplication.Current);
                    properties.Add("I18n", I18n.Instance);
                    Command CommandContextPopOverlay = new Command();
                    properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                    List <TitleFilter> newFilter = new List <TitleFilter>(m_filters);
                    newFilter.Add(new TitleFilter(TitleFilterType.DateAdded, dateAdded.Name));

                    Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, testGroup2.Description);

                    properties.Add("Page", gallery);
                    OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                };
                testGroup2.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate;
                this.m_listContent.Add(testGroup2);
            }

            this.IsBusy = false;
        }
Beispiel #4
0
        public GenreItem(UserFilter title, IModelItem owner, List<TitleFilter> filter)
            : base(owner)
        {
            this.Description = title.Name;

            this.Invoked += delegate(object sender, EventArgs args)
            {
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                properties.Add("I18n", I18n.Instance);
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(filter, title.Name);

                properties.Add("Page", gallery);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #5
0
        public FilterItem(UserFilter title, IModelItem owner, List <TitleFilter> filter)
            : base(owner)
        {
            this.Description = title.Name;

            this.Invoked += delegate(object sender, EventArgs args)
            {
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                properties.Add("I18n", I18n.Instance);
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(filter, title.Name);

                properties.Add("Page", gallery);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #6
0
        private void loadBackground(object options)
        {
            foreach (FilteredTitleCollection year in TitleCollectionManager.GetAllYearsGrouped(m_filters))
            {
                Library.Code.V3.YearBrowseGroup testGroup2 = new Library.Code.V3.YearBrowseGroup(new List <Title>(year.Titles));
                testGroup2.Owner = this;
                //tmp hack for unknown dates
                if (year.Name == "1900")
                {
                    testGroup2.Description = "UNKNOWN";
                }
                else
                {
                    testGroup2.Description = year.Name;
                }

                testGroup2.DefaultImage = null;
                testGroup2.Invoked     += delegate(object sender, EventArgs args)
                {
                    OMLProperties properties = new OMLProperties();
                    properties.Add("Application", OMLApplication.Current);
                    properties.Add("I18n", I18n.Instance);
                    Command CommandContextPopOverlay = new Command();
                    properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                    List <TitleFilter> newFilter = new List <TitleFilter>(m_filters);
                    newFilter.Add(new TitleFilter(TitleFilterType.Year, year.Name));

                    Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, testGroup2.Description);

                    properties.Add("Page", gallery);
                    OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                };

                testGroup2.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate;
                m_listContent.Add(testGroup2);
            }

            this.IsBusy = false;
        }
        //private void GoToWizard(List<OMLEngine.TitleFilter> filters, string name)
        //{
        //    OMLProperties properties = new OMLProperties();
        //    properties.Add("Application", this);
        //    properties.Add("I18n", I18n.Instance);
        //    //v3 main gallery
        //    Library.Code.V3.WizardGalleryPage gallery = new Library.Code.V3.WizardGalleryPage(filters, name);
        //    //description
        //    gallery.Description = name;
        //    Command CommandContextPopOverlay = new Command();
        //    properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
        //    properties.Add("Page", gallery);
        //    _session.GoToPage(@"resx://Library/Library.Resources/V3_WizardGalleryPage", properties);
        //}

        private void GoHome(List<OMLEngine.TitleFilter> filters, string name)
        {
            OMLProperties properties = new OMLProperties();
            properties.Add("Application", this);
            properties.Add("I18n", I18n.Instance);
            //v3 main gallery
            Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(filters, name);
            //description
            gallery.Description = name;
            Command CommandContextPopOverlay = new Command();
            properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
            properties.Add("Page", gallery);
            _session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
        }
        // this is the context from the Media Center menu
        public void Startup(string context)
        {            
            OMLApplication.DebugLine("[OMLApplication] Startup({0}) {1}", context, IsExtender ? "Extender" : "Native");
            // DISABLE THIS UNTIL ITS READY -- DJShultz 01/13/2009

            //if (!IsExtender) {
            OperatingSystem os = Environment.OSVersion;
            if (os.Version.Major >= 6 && os.Version.Minor >= 1)
                Properties.Settings.Default.IsWindows7 = true;
            else
                Properties.Settings.Default.IsWindows7 = false;

            Properties.Settings.Default.Save();
            //}
            //should we update?
            if (OMLSettings.EnableAutomaticUpdates)
            {
                bool enableBetaUpdates = OMLSettings.EnableAutomaticUpdatesDailyBuilds;
                OMLUpdater updater = new OMLUpdater();
                ThreadPool.QueueUserWorkItem(new WaitCallback(updater.checkUpdate), enableBetaUpdates);
            }

#if LAYOUT_V3

            #region v3POC

            SetPrimaryBackgroundImage();
            //this.MediaCenterEnvironment.Dialog(
            //            string.Format("Loading MC UI"),
            //            "TEST", DialogButtons.Ok, 5, false);
            //this.GoToWizard(new List<OMLEngine.TitleFilter>(), "Movies");
            //return;
            switch (context)
            {
                case "Settings":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.SettingsManager page = new Library.Code.V3.SettingsManager();
                        properties["Page"] = page;
                        properties["Application"] = OMLApplication.Current;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_Settings_SettingsManager", properties);
                        return;
                    }
                case "Search":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.MoviesSearchPage page = new Library.Code.V3.MoviesSearchPage();
                        properties["Page"] = page;
                        properties["Application"] = OMLApplication.Current;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MoviesSearchPage", properties);
                        return;
                    }
                case "Trailers":
                    {
                        OMLProperties properties = new OMLProperties();
                        properties.Add("Application", this);
                        properties.Add("I18n", I18n.Instance);
                        Library.Code.V3.TrailerPage gallery = new Library.Code.V3.TrailerPage("trailers");
                        Command CommandContextPopOverlay = new Command();
                        properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                        properties.Add("Page", gallery);
                        _session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                        return;
                    }
                case "Custom1":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom2":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom3":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom4":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom5":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "FirstRun":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                        properties["Page"] = page;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                        return;
                    }
                case "TV":
                    {
                        List<OMLEngine.TitleFilter> filters = new List<OMLEngine.TitleFilter>();
                        filters.Add(new OMLEngine.TitleTypeFilter(OMLEngine.TitleTypes.TVShow));
                        this.GoHome(filters, "TV");
                        return;
                    }
                case "Movies":
                    {
                        this.GoHome(new List<OMLEngine.TitleFilter>(), "Movies");
                        return;
                    }
                default:
                    {
                        ////everything else for now
                        //OMLProperties properties = new OMLProperties();
                        //properties.Add("Application", this);
                        ////properties.Add("UISettings", new UISettings());
                        ////properties.Add("Settings", new Settings());
                        //properties.Add("I18n", I18n.Instance);
                        ////v3 main gallery
                        //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                        ////description
                        //gallery.Description = "OML";
                        //Command CommandContextPopOverlay = new Command();
                        //properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                        //properties.Add("Page", gallery);
                        //_session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                        ////this.mediaChangers = new Library.Code.V3.MediaChangeManager();
                        if (Properties.Settings.Default.CompletedFirstRun == false)
                        {
                            Dictionary<string, object> properties = new Dictionary<string, object>();

                            Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                            properties["Page"] = page;

                            OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                        }
                        else
                            this.GoHome(new List<OMLEngine.TitleFilter>(), "OML");
                        return;
                    }
            }
            #endregion v3POC
            //return;
#endif

        }
        //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
        }
        private void loadBackground(object options)
        {
            foreach (FilteredTitleCollection dateAdded in TitleCollectionManager.GetAllDateAddedGrouped(m_filters))
            {
                Library.Code.V3.YearBrowseGroup testGroup2 = new Library.Code.V3.YearBrowseGroup(new List<Title>(dateAdded.Titles));

                testGroup2.Owner = this;
                testGroup2.Description = dateAdded.Name;
                testGroup2.DefaultImage = null;// new Image("resx://Library/Library.Resources/Genre_Sample_mystery");
                testGroup2.Invoked += delegate(object sender, EventArgs args)
                {
                    OMLProperties properties = new OMLProperties();
                    properties.Add("Application", OMLApplication.Current);
                    properties.Add("I18n", I18n.Instance);
                    Command CommandContextPopOverlay = new Command();
                    properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                    List<TitleFilter> newFilter = new List<TitleFilter>(m_filters);
                    newFilter.Add(new TitleFilter(TitleFilterType.DateAdded, dateAdded.Name));

                    Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, testGroup2.Description);

                    properties.Add("Page", gallery);
                    OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                };
                testGroup2.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate;
                this.m_listContent.Add(testGroup2);
            }

            this.IsBusy = false;
        }
Beispiel #11
0
        private void loadBackground(object options)
        {
            foreach (FilteredTitleCollection year in TitleCollectionManager.GetAllYearsGrouped(m_filters))
            {
                Library.Code.V3.YearBrowseGroup testGroup2 = new Library.Code.V3.YearBrowseGroup(new List<Title>(year.Titles));
                testGroup2.Owner = this;
                //tmp hack for unknown dates
                if (year.Name == "1900")
                    testGroup2.Description = "UNKNOWN";
                else
                    testGroup2.Description = year.Name;

                testGroup2.DefaultImage = null;
                testGroup2.Invoked += delegate(object sender, EventArgs args)
                {
                    OMLProperties properties = new OMLProperties();
                    properties.Add("Application", OMLApplication.Current);
                    properties.Add("I18n", I18n.Instance);
                    Command CommandContextPopOverlay = new Command();
                    properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);

                    List<TitleFilter> newFilter = new List<TitleFilter>(m_filters);
                    newFilter.Add(new TitleFilter(TitleFilterType.Year, year.Name));

                    Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(newFilter, testGroup2.Description);

                    properties.Add("Page", gallery);
                    OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                };

                testGroup2.ContentLabelTemplate = Library.Code.V3.BrowseGroup.StandardContentLabelTemplate;
                m_listContent.Add(testGroup2);
            }

            this.IsBusy = false;
        }
        public CollectionItem(Title title, IModelItem owner)
            : base(owner)
        {
            this._titleObj = title;
            //this.InternalMovieItem = new Library.MovieItem(title, null);

            this.ItemType = 0;
            if(OMLEngine.Settings.OMLSettings.ShowUnwatchedIcon)
                this.OverlayContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGalleryItem#UnwatchedOverlay";
            if (this._titleObj.WatchedCount == 0)
                this.isUnwatched = true;

            DateTime releaseDate = Convert.ToDateTime(_titleObj.ReleaseDate.ToString("MMMM dd, yyyy"));// new DateTime(2000, 1, 1);
            //invalid dates
            if (releaseDate.Year != 1 && releaseDate.Year != 1900)
                this.MetadataTop = releaseDate.Year.ToString();
            else
                this.MetadataTop = "";

            this.ItemId = 1;
            string starRating = Convert.ToString(Math.Round((Convert.ToDouble(_titleObj.UserStarRating.HasValue ? _titleObj.UserStarRating.Value : 0) * 0.8), MidpointRounding.AwayFromZero));
            this.StarRating = starRating;
            string extendedMetadata = string.Empty;

            this.SortName = title.SortName;

            //this.Metadata = this.InternalMovieItem.Rating.Replace("PG13", "PG-13").Replace("NC17", "NC-17");
            this.Metadata = _titleObj.ParentalRating;
            if (string.IsNullOrEmpty(_titleObj.ParentalRating))
                this.Metadata = "Not Rated";
            if (_titleObj.Runtime.ToString() != "0")
                this.Metadata += string.Format(", {0} minutes", _titleObj.Runtime.ToString());
            this.Tagline = _titleObj.Synopsis;

            this.Description = title.Name;

            //TODO: not sure how to read this yet...
            //temporarially disabled due to bug in eagerloading
            //this.SimpleVideoFormat = _titleObj.VideoFormat.ToString();

            this.Invoked += delegate(object sender, EventArgs args)
            {
                //stub details for CollectionItem
                CollectionPage page = new CollectionPage(this);
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                //properties.Add("UISettings", new UISettings());
                //properties.Add("Settings", new Settings());
                properties.Add("I18n", I18n.Instance);
                //v3 main gallery
                //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                ////description
                //gallery.Description = "OML";
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                properties.Add("Page", page);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #13
0
        public SeasonItem(Title title, IModelItem owner)
            : base(owner)
        {
            this._titleObj = title;
            //this.InternalMovieItem = new Library.MovieItem(title, null);

            this.ItemType = 0;
            if (OMLEngine.Settings.OMLSettings.ShowUnwatchedIcon)
            {
                this.OverlayContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGalleryItem#UnwatchedOverlay";
            }
            if (this._titleObj.WatchedCount == 0)
            {
                this.isUnwatched = true;
            }

            DateTime releaseDate = Convert.ToDateTime(_titleObj.ReleaseDate.ToString("MMMM dd, yyyy"));// new DateTime(2000, 1, 1);

            //invalid dates
            if (releaseDate.Year != 1 && releaseDate.Year != 1900)
            {
                this.MetadataTop = releaseDate.Year.ToString();
            }
            else
            {
                this.MetadataTop = "";
            }

            this.ItemId = 1;
            string starRating = Convert.ToString(Math.Round((Convert.ToDouble(_titleObj.UserStarRating.HasValue ? _titleObj.UserStarRating.Value : 0) * 0.8), MidpointRounding.AwayFromZero));

            this.StarRating = starRating;
            string extendedMetadata = string.Empty;

            this.SortName = title.SortName;

            //this.Metadata = this.InternalMovieItem.Rating.Replace("PG13", "PG-13").Replace("NC17", "NC-17");
            this.Metadata = _titleObj.ParentalRating;
            if (string.IsNullOrEmpty(_titleObj.ParentalRating))
            {
                this.Metadata = "Not Rated";
            }
            if (_titleObj.Runtime.ToString() != "0")
            {
                this.Metadata += string.Format(", {0} minutes", _titleObj.Runtime.ToString());
            }
            this.Tagline = _titleObj.Synopsis;

            this.Description = title.Name;

            //TODO: not sure how to read this yet...
            //temporarially disabled due to bug in eagerloading
            //this.SimpleVideoFormat = _titleObj.VideoFormat.ToString();


            this.Invoked += delegate(object sender, EventArgs args)
            {
                //stub details for CollectionItem
                SeasonPage    page       = new SeasonPage(this);
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                //properties.Add("UISettings", new UISettings());
                //properties.Add("Settings", new Settings());
                properties.Add("I18n", I18n.Instance);
                //v3 main gallery
                //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                ////description
                //gallery.Description = "OML";
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                properties.Add("Page", page);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
Beispiel #14
0
        private void ParseDocument(XmlDocument xDoc)
        {
            //this.trailers = new List<TrailerItem>();
            XPathNavigator nav = xDoc.CreateNavigator();

            XPathExpression expr;

            expr = nav.Compile("//*/genre/name[not(.=preceding::*/genre/name)] ");
            XPathNodeIterator iterator = nav.Select(expr);

            // Iterate on the node set
            //genres = new List<TrailerGenreItem>();
            while (iterator.MoveNext())
            {
                XPathNavigator nav2 = iterator.Current.Clone();
                Application.DeferredInvoke(delegate
                {
                    TrailerGenreItem genre = new TrailerGenreItem(this);
                    genre.Description      = nav2.Value;
                    genre.Invoked         += delegate(object genreSender, EventArgs genreArgs)
                    {
                        OMLProperties properties = new OMLProperties();
                        properties.Add("Application", OMLApplication.Current);
                        properties.Add("I18n", I18n.Instance);
                        Library.Code.V3.TrailerPage gallery = new Library.Code.V3.TrailerPage("trailers", genre);
                        Command CommandContextPopOverlay    = new Command();
                        properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                        //add name piv
                        List <TrailerItem> nameTrailers = this.SortTrailersByName(genre.Trailers) as List <TrailerItem>;
                        VirtualList nameGalleryList     = new VirtualList(gallery, null);
                        foreach (TrailerItem t in nameTrailers)
                        {
                            nameGalleryList.Add(t);
                        }
                        Library.Code.V3.BrowsePivot namePivot = new Library.Code.V3.BrowsePivot(gallery, "title", "No titles were found.", nameGalleryList);
                        namePivot.ContentLabel = genre.Description;
                        namePivot.SetupContextMenu();
                        namePivot.SupportsJIL     = true;
                        namePivot.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery";

                        namePivot.ContentItemTemplate = "oneRowGalleryItemPoster";
                        namePivot.DetailTemplate      = Library.Code.V3.BrowsePivot.ExtendedDetailTemplate;
                        gallery.Model.Pivots.Options.Add(namePivot);
                        gallery.Model.Pivots.Chosen = namePivot;

                        List <TrailerItem> dateTrailers = this.SortTrailersByDate(genre.Trailers) as List <TrailerItem>;
                        VirtualList dateGalleryList     = new VirtualList(gallery, null);
                        foreach (TrailerItem t in dateTrailers)
                        {
                            dateGalleryList.Add(t);
                        }
                        Library.Code.V3.BrowsePivot datePivot = new Library.Code.V3.BrowsePivot(gallery, "date added", "No titles were found.", dateGalleryList);
                        datePivot.ContentLabel = genre.Description;
                        datePivot.SetupContextMenu();
                        datePivot.SupportsJIL     = true;
                        datePivot.ContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGallery#Gallery";

                        datePivot.ContentItemTemplate = "oneRowGalleryItemPoster";
                        datePivot.DetailTemplate      = Library.Code.V3.BrowsePivot.ExtendedDetailTemplate;
                        gallery.Model.Pivots.Options.Add(datePivot);

                        properties.Add("Page", gallery);
                        OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                    };
                    genres.Add(genre);
                });
            }

            if (nav.MoveToChild("records", ""))
            {
                XPathNodeIterator nIter = nav.SelectChildren("movieinfo", "");
                nav.MoveToFirstChild();
                XPathNavigator localNav = nav.CreateNavigator();
                nav.MoveToParent();

                for (int i = 0; i < nIter.Count; i++)
                {
                    Application.DeferredInvoke(delegate
                    {
                        TrailerItem currentTrailer = new TrailerItem(this);

                        if (localNav.MoveToChild("info", ""))
                        {
                            currentTrailer.Copyright = GetChildNodesValue(localNav, "copyright");
                            currentTrailer.Tagline   = GetChildNodesValue(localNav, "description");
                            currentTrailer.Director  = GetChildNodesValue(localNav, "director");
                            //currentTrailer.Postdate = GetChildNodesValue(localNav, "postdate");
                            currentTrailer.Rating = GetChildNodesValue(localNav, "rating");
                            //currentTrailer.ReleaseDate = GetChildNodesValue(localNav, "releasedate");
                            string postdate = GetChildNodesValue(localNav, "postdate");
                            if (!string.IsNullOrEmpty(postdate))
                            {
                                try
                                {
                                    currentTrailer.Postdate = Convert.ToDateTime(postdate);
                                }
                                catch
                                {
                                    currentTrailer.Postdate = new DateTime(1900, 1, 1);
                                }
                            }
                            string releaseDate = GetChildNodesValue(localNav, "releasedate");
                            if (!string.IsNullOrEmpty(releaseDate))
                            {
                                try
                                {
                                    currentTrailer.ReleaseDate = Convert.ToDateTime(releaseDate);
                                    currentTrailer.MetadataTop = string.Format("{0}, in theaters {1}", currentTrailer.Rating, currentTrailer.ReleaseDate.ToString("D", CultureInfo.CreateSpecificCulture("en-US")));
                                }
                                catch
                                {
                                    currentTrailer.ReleaseDate = new DateTime(1900, 1, 1);
                                }
                            }
                            currentTrailer.Runtime     = GetChildNodesValue(localNav, "runtime");
                            currentTrailer.Studio      = GetChildNodesValue(localNav, "studio");
                            currentTrailer.Metadata    = currentTrailer.Studio;
                            currentTrailer.Description = GetChildNodesValue(localNav, "title");
                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("cast", ""))
                        {
                            XPathNodeIterator castIter = localNav.SelectChildren("name", "");
                            if (localNav.MoveToFirstChild())
                            {
                                XPathNavigator castNav = localNav.CreateNavigator();

                                for (int j = 0; j < castIter.Count; j++)
                                {
                                    currentTrailer.Actors.Add(castNav.Value);
                                    castNav.MoveToNext("name", "");
                                }
                                localNav.MoveToParent();
                            }
                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("genre", ""))
                        {
                            XPathNodeIterator genreIter = localNav.SelectChildren("name", "");
                            if (localNav.MoveToFirstChild())
                            {
                                XPathNavigator genreNav = localNav.CreateNavigator();

                                for (int k = 0; k < genreIter.Count; k++)
                                {
                                    currentTrailer.Genres.Add(genreNav.Value);
                                    genreNav.MoveToNext("name", "");
                                }
                                localNav.MoveToParent();
                            }
                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("poster", ""))
                        {
                            if (localNav.MoveToChild("location", ""))
                            {
                                currentTrailer.PosterUrl = localNav.Value;
                                localNav.MoveToParent();
                            }

                            if (localNav.MoveToChild("xlarge", ""))
                            {
                                currentTrailer.XLargePosterUrl = localNav.Value;
                                localNav.MoveToParent();
                            }

                            localNav.MoveToParent();
                        }

                        if (localNav.MoveToChild("preview", ""))
                        {
                            if (localNav.MoveToChild(XPathNodeType.Element))
                            {
                                currentTrailer.TrailerUrl = localNav.Value;
                                currentTrailer.Filesize   = localNav.GetAttribute("filesize", "");
                                localNav.MoveToParent();
                            }
                            localNav.MoveToParent();
                        }

                        trailers.Add(currentTrailer);

                        //this could probably be done better
                        foreach (string strGenre in currentTrailer.Genres)
                        {
                            foreach (TrailerGenreItem genre in this.genres)
                            {
                                if (strGenre == genre.Description)
                                {
                                    genre.Trailers.Add(currentTrailer);
                                    break;
                                }
                            }
                        }

                        localNav.MoveToNext();
                    });
                }
            }
            //return trailers;
        }