Exemplo n.º 1
0
        public void SetMRULists()
        {
            if (OMLEngine.Settings.OMLSettings.UseMPAAList)
            {
                // MaskBox is a hidden property
                // It is explained on the DevExpress Website at:
                //
                // http://www.devexpress.com/Support/Center/p/Q181219.aspx
                //
                teParentalRating.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
                teParentalRating.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
                teParentalRating.MaskBox.AutoCompleteCustomSource.AddRange(OMLEngine.Settings.OMLSettings.MPAARatings.Split('|'));
            }
            else
            {
                teParentalRating.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
                teParentalRating.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
                foreach (string name in from t in TitleCollectionManager.GetAllParentalRatings(null) select t.Name)
                {
                    teParentalRating.MaskBox.AutoCompleteCustomSource.Add(name);
                }
            }

            txtStudio.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            txtStudio.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (string name in from t in TitleCollectionManager.GetAllStudios(null) select t.Name)
            {
                txtStudio.MaskBox.AutoCompleteCustomSource.Add(name);
            }

            txtAspectRatio.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            txtAspectRatio.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (string name in from t in TitleCollectionManager.GetAllAspectRatios(null) select t.Name)
            {
                txtAspectRatio.MaskBox.AutoCompleteCustomSource.Add(name);
            }

            txtCountryOfOrigin.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            txtCountryOfOrigin.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (string name in from t in TitleCollectionManager.GetAllCountryOfOrigin(null) select t.Name)
            {
                txtCountryOfOrigin.MaskBox.AutoCompleteCustomSource.Add(name);
            }

            teVideoResolution.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            teVideoResolution.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            foreach (string name in from t in TitleCollectionManager.GetAllAspectRatios(null) select t.Name)
            {
                teVideoResolution.MaskBox.AutoCompleteCustomSource.Add(name);
            }

            teVideoStandard.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            teVideoStandard.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            //teVideoStandard.MaskBox.AutoCompleteCustomSource.AddRange(MainEditor._titleCollection.GetAllVideoStandards.ToArray());

            teImporter.MaskBox.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            teImporter.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            //teImporter.MaskBox.AutoCompleteCustomSource.AddRange(MainEditor._titleCollection.GetAllImporterSources.ToArray());
        }
Exemplo n.º 2
0
        public IList <GalleryItem> GetGalleryItems()
        {
            List <GalleryItem> items = new List <GalleryItem>();
            //items.Add(new GalleryItem(_gallery, AllItems, AllItems, this));

            IEnumerable <FilteredCollection> filteredItems = null;

            switch (filterType)
            {
            case TitleFilterType.Genre:
                filteredItems = TitleCollectionManager.GetAllGenres(existingFilters);
                //IEnumerable<FilteredCollectionWithImages> fc = TitleCollectionManager.GetAllGenresWithImages(existingFilters);
                //foreach (FilteredCollectionWithImages gen in fc)
                //{

                //}
                break;

            case TitleFilterType.ParentalRating:
                filteredItems = TitleCollectionManager.GetAllParentalRatings(existingFilters);
                break;

            case TitleFilterType.VideoFormat:
                filteredItems = TitleCollectionManager.GetAllVideoFormats(existingFilters);
                break;

            case TitleFilterType.Runtime:
                filteredItems = TitleCollectionManager.GetAllRuntimes(existingFilters);
                break;

            case TitleFilterType.Year:
                filteredItems = TitleCollectionManager.GetAllYears(existingFilters);
                break;

            case TitleFilterType.Country:
                filteredItems = TitleCollectionManager.GetAllCountries(existingFilters);
                break;

            case TitleFilterType.Tag:
                filteredItems = TitleCollectionManager.GetAllTags(existingFilters);
                break;

            case TitleFilterType.Director:
                filteredItems = TitleCollectionManager.GetAllPeople(existingFilters, PeopleRole.Director);
                break;

            case TitleFilterType.Actor:
                filteredItems = TitleCollectionManager.GetAllPeople(existingFilters, PeopleRole.Actor);
                break;

            case TitleFilterType.UserRating:
                filteredItems = TitleCollectionManager.GetAllUserRatings(existingFilters);
                break;

            case TitleFilterType.DateAdded:
                filteredItems = TitleCollectionManager.GetAllDateAdded(existingFilters);
                break;

            default:
                throw new ArgumentException("Unknown filter type");
            }

            if (filteredItems != null)
            {
                foreach (FilteredCollection item in filteredItems)
                {
                    GalleryItem galleryItem = new GalleryItem(_gallery, item.Name, item.Name, this, item.Count);
                    if (!string.IsNullOrEmpty(item.ImagePath))
                    {
                        //TODO:ASYNC this
                        galleryItem.MenuCoverArt = MovieItem.LoadImage(item.ImagePath);
                    }

                    items.Add(galleryItem);
                }
            }

            return(items);
        }