示例#1
0
        public MovieGallery(List <TitleFilter> filters)
        {
            this.filters = filters;

            if (filters != null && filters.Count != 0)
            {
                // create the title given the list of filters
                StringBuilder sb = new StringBuilder(filters.Count * 10);
                sb.Append(Filter.Home);

                foreach (TitleFilter filter in filters)
                {
                    sb.Append(" > ");
                    if (!string.IsNullOrEmpty(filter.FilterText))
                    {
                        sb.Append(filter.FilterText);
                    }
                    else
                    {
                        sb.Append(filter.FilterType.ToString());
                    }
                }

                _title = sb.ToString();
            }
            else
            {
                _title = Filter.Home;
            }

            Initialize(TitleCollectionManager.GetFilteredTitles(this.filters));
        }
示例#2
0
        void actorCommand_Invoked(object sender, EventArgs e)
        {
            Library.Code.V3.CastCommand actor  = (Library.Code.V3.CastCommand)sender;
            List <TitleFilter>          filter = new List <TitleFilter>();

            filter.Add(new TitleFilter(TitleFilterType.Person, actor.Description));
            IEnumerable <Title> items = TitleCollectionManager.GetFilteredTitles(filter);
            GalleryPage         page  = new GalleryPage(items, actor.Description);
        }
示例#3
0
 public void SetFilter(List <TitleFilter> tf)
 {
     try
     {
         List <Title> titles = TitleCollectionManager.GetFilteredTitles(tf).ToList();
         ShowResults(titles);
     }
     catch
     {
         grdTitles.Rows.Clear();
     }
 }
示例#4
0
        public void TEST_GET_ALL_MOVIES_FOR_ACTOR()
        {
            Console.WriteLine("Starting to get all Tim Burton movies");
            DateTime start = DateTime.Now;

            IEnumerable <Title> items = TitleCollectionManager.GetFilteredTitles(TitleFilterType.Person, "Tim Burton");

            foreach (Title title in items)
            {
                Console.WriteLine(title.Name);
            }

            Console.WriteLine(string.Format("Done - Took: {0} milliseconds for {1} titles",
                                            (DateTime.Now - start).TotalMilliseconds.ToString(),
                                            items.Count()));
        }
示例#5
0
        public void TEST_GET_ACTORS_UNWATCHED()
        {
            Console.WriteLine("Starting to get all unwatched Harrison Ford Movies");
            DateTime start = DateTime.Now;

            List <TitleFilter> filter = new List <TitleFilter>();

            filter.Add(new TitleFilter(TitleFilterType.Person, "Harrison Ford (1942)"));
            filter.Add(new TitleFilter(TitleFilterType.Unwatched, null));

            IEnumerable <Title> items = TitleCollectionManager.GetFilteredTitles(filter);

            foreach (Title item in items)
            {
                Console.WriteLine(item.Name);
            }

            Console.WriteLine(string.Format("Done - Took: {0} milliseconds for {1} titles",
                                            (DateTime.Now - start).TotalMilliseconds.ToString(),
                                            items.Count()));
        }
示例#6
0
        public void TEST_GETTING_ALL_TITLES()
        {
            List <TitleFilter> filters = new List <TitleFilter>();

            filters.Add(new TitleFilter(TitleFilterType.Genre, "Drama", true));
            filters.Add(new TitleFilter(TitleFilterType.Genre, "Comedy", true));

            List <Title> titles = new List <Title>(TitleCollectionManager.GetFilteredTitles(filters));

            foreach (Title title in titles)
            {
                Console.WriteLine(title.Name);
            }

            return;


            OMLEngine.Trailers.AppleTrailers trailer = new OMLEngine.Trailers.AppleTrailers(OMLEngine.Trailers.AppleTrailerRes.HiRes);

            foreach (OMLEngine.Trailers.AppleTrailer trail in trailer.AllTrailers)
            {
                Console.WriteLine(trail.Title);
            }

            return;

            Console.WriteLine("Starting to get all titles");
            DateTime start = DateTime.Now;

            IEnumerable <FilteredCollectionWithImages> items = TitleCollectionManager.GetAllGenresWithImages(null);


            //IEnumerable<FilteredTitleCollection> items = TitleCollectionManager.GetAllYearsGrouped(new List<TitleFilter>() { new TitleFilter(TitleFilterType.Genre, "Horror") });

            /*
             *
             * IEnumerable<Title> titles = TitleCollectionManager.GetAllTitles();
             *
             * foreach (Title title in titles)
             * {
             *  Console.WriteLine(title.Name + title.Disks.Count + title.FrontCoverMenuPath);
             * }*/

            /*foreach (FilteredTitleCollection col in items)
             * {
             *  Console.WriteLine(col.Name);
             *
             *  foreach (Title title in col.Titles)
             *  {
             *      Console.WriteLine(title.Name);
             *  }
             * }*/

            foreach (FilteredCollectionWithImages col in items)
            {
                Console.WriteLine(col.Name + " " + col.Count);

                int x = 0;

                foreach (int id in col.ImageIds)
                {
                    if (x++ == 6)
                    {
                        break;
                    }

                    Console.Write(id);
                }
            }

            Console.WriteLine(string.Format("Done - Took: {0} milliseconds for {1} titles",
                                            (DateTime.Now - start).TotalMilliseconds.ToString(),
                                            items
                                            .Count()));
        }
示例#7
0
 public IEnumerable <Title> GetFilteredTitles()
 {
     return(TitleCollectionManager.GetFilteredTitles(filters));
 }