/// <summary>
        /// Adds the given tag to the list of selected tags, if it is not already added.
        /// </summary>
        /// <param name="parameter">The tag to add, as a string.</param>
        public void AddTag(object parameter)
        {
            string tag = parameter as string;

            if (!CurrentTags.Contains(tag))
            {
                CurrentTags.Add(tag);
            }
        }
        private void DisplayTagTree(ImageTag tag, int level)
        {
            // TODO: Can likely be optimised
            if (tag.Type != ImageTagTypes.Root && CurrentTags.Contains(tag))
            {
                DisplayTag(tag, level);
            }

            foreach (ImageTag child in tag.Children)
            {
                DisplayTagTree(child, level + 1);
            }
        }
예제 #3
0
        /// <summary>
        /// Adds a tag to the current image.
        /// </summary>
        /// <param name="tag"></param>
        void AddTagToImage(Tag tag)
        {
            if (CurrentTags.Contains(tag))
            {
                return;
            }

            CurrentTags.Add(tag);
            foreach (var image in _selectedItems)
            {
                if (image == SelectedImage)
                {
                    continue;
                }

                _imageTags[image.FilePath].Add(tag);
            }

            RegisterTagEvents(tag, true);
        }