コード例 #1
0
ファイル: MusicByTagsActions.cs プロジェクト: zBart/Ares
        public RemoveAllTagsFromMusicByTagsAction(IMusicByTags element)
        {
            m_Element = element;
            m_OldTags = new Dictionary <int, HashSet <int> >();
            IDictionary <int, HashSet <int> > oldTags = element.GetTags();

            foreach (int category in oldTags.Keys)
            {
                HashSet <int> tags = new HashSet <int>();
                tags.UnionWith(oldTags[category]);
                m_OldTags[category] = tags;
            }
        }
コード例 #2
0
        public static IList <String> GetAllMatchingFiles(this IMusicByTags musicByTags)
        {
            try
            {
                var db = Ares.Tags.TagsModule.GetTagsDB().ReadInterface;
                switch (musicByTags.TagCategoryCombination)
                {
                case TagCategoryCombination.UseOneTagOfEachCategory:
                    return(db.GetAllFilesWithAnyTagInEachCategory(musicByTags.GetTags()));

                case TagCategoryCombination.UseAnyTag:
                    return(db.GetAllFilesWithAnyTag(musicByTags.GetAllTags()));

                case TagCategoryCombination.UseAllTags:
                default:
                    return(db.GetAllFilesWithAllTags(musicByTags.GetAllTags()));
                }
            }
            catch (Ares.Tags.TagsDbException)
            {
                return(new List <String>());
            }
        }