Exemplo n.º 1
0
        private ReadOnlyCollection <MediaInstance> GetFilteredMedia(SearchMediaData searchMedia)
        {
            var tagFilter     = new TagFilter(searchMedia.IncludedTags, searchMedia.ExcludedTags, _tagGraph.Object);
            var filteredMedia = tagFilter.Filter(_mediaInstances.ToList().AsReadOnly());

            return(filteredMedia);
        }
Exemplo n.º 2
0
        private void search_button_Click(object sender, EventArgs e)
        {// Begins identification on button click.
            //Creates new image tagger object and inputs user path through the GetTags method
            ImageTagger animalImageTagger = new ImageTagger();
            List <Tag>  tags = animalImageTagger.GetTagsForImage(textBoxText);

            //creates new tag filter and then runs the tag list through it
            TagFilter  filter       = new TagFilter();
            List <Tag> filteredTags = filter.Filter(tags);

            foreach (Tag tag in tags)
            {
                if (tag.name == "cat")
                {
                    checkBox2.Checked = true;
                }
                if (tag.name == "dog")
                {
                    checkBox1.Checked = true;
                }
                if (tag.name == "bird")
                {
                    checkBox3.Checked = true;
                }
            }
        }