Ejemplo n.º 1
0
        public void TEST_GET_ALL_ALPHAINDEX()
        {
            Console.WriteLine("Starting to get all date added values");
            DateTime start = DateTime.Now;

            List <List <Title> > titlesCollection = new List <List <Title> >();

            IEnumerable <FilteredTitleCollection> items = TitleCollectionManager.GetAllAlphaIndex(null);

            List <FilteredTitleCollection> allItems = new List <FilteredTitleCollection>(items);

            foreach (FilteredTitleCollection item in allItems)
            {
                List <Title> list = new List <Title>();

                foreach (Title title in item.Titles)
                {
                    list.Add(title);
                }

                titlesCollection.Add(list);
            }

            Console.WriteLine(string.Format("Done - Took: {0} milliseconds for {1} titles",
                                            (DateTime.Now - start).TotalMilliseconds.ToString(),
                                            titlesCollection.Count));
        }
Ejemplo n.º 2
0
        private void loadBackground(object options)
        {
            foreach (FilteredTitleCollection alpha in TitleCollectionManager.GetAllAlphaIndex(m_filters))
            {
                Library.Code.V3.YearBrowseGroup testGroup2 = new Library.Code.V3.YearBrowseGroup(new List <Title>(alpha.Titles));
                testGroup2.Owner = this;

                testGroup2.Description = alpha.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, alpha.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;
        }