示例#1
0
        private static BaseItem UnknownItem(IndexType indexType)
        {
            const string unknown = "<Unknown>";

            switch (indexType)
            {
            case IndexType.Director:
            case IndexType.Actor:
                return(Person.GetPerson(unknown));

            case IndexType.Studio:
                return(Studio.GetStudio(unknown));

            case IndexType.Year:
                return(Year.GetYear(unknown));

            default:
                return(Genre.GetGenre(unknown));
            }
        }
示例#2
0
        protected virtual Func <string, BaseItem> GetConstructor(string property)
        {
            switch (property)
            {
            case "Actors":
            case "Directors":
                return(a => Person.GetPerson(a));

            case "Genres":
                return(g => Genre.GetGenre(g));

            case "ProductionYear":
                return(y => Year.GetYear(y));

            case "Studios":
                return(s => Studio.GetStudio(s));

            default:
                return(i => GenericItem.GetItem(i));
            }
        }