예제 #1
0
        public bool AddMediaItemToSet(string SetName, Guid ImageID)
        {
            ResultSet sets = GetAllMediaSets();

            if (sets.Exists(s => (s as MediaSet).SetName == SetName))
            {
                MediaSet set = sets.Find(s => (s as MediaSet).SetName == SetName) as MediaSet;
                set.ImageIDS.Add(ImageID);
                return(true);
            }
            return(false);
        }
예제 #2
0
        public MediaSet AddMediaSet(string SetName)
        {
            ResultSet sets = GetAllMediaSets();

            if (!sets.Exists(s => (s as MediaSet).SetName == SetName))
            {
                Guid     setID = GetGuid();
                MediaSet set   = new MediaSet(setID, SetName);
                Model.Taggables.Add(setID, set);
                return(set);
            }
            return(null);
        }
예제 #3
0
        /*public ResultSet RunQuery(string Query)
         * {
         *
         * }*/

        public ResultSet GetMediaItemsForSet(Guid SetID)
        {
            if (Model.Taggables.ContainsKey(SetID))
            {
                MediaSet set = Model.Taggables[SetID] as MediaSet;
                if (set != null)
                {
                    ResultSet results = new ResultSet();
                    foreach (Guid imageID in set.ImageIDS)
                    {
                        results.Add(Model.Taggables[imageID]);
                    }
                    return(results);
                }
            }
            return(new ResultSet());
        }