public void AdjustTags(TagHolders tagHolder)
        {
            var groups = GroupTagCollection;

            foreach (var group in groups)
            {
                var  tagsToReplace = group.IndedifiableTags;
                bool addGroupTag   = false;
                foreach (var tag in tagsToReplace)
                {
                    if (tagHolder.HasTag(tag))
                    {
                        tagHolder.RemoveTag(tag);
                        addGroupTag = true;
                    }
                    else
                    {
                        if (tagHolder.HasTagInGroup(tag))
                        {
                            string groupName = tagHolder.GetTagFromPartGroup(tag);
                            tagHolder.RemoveTag(groupName);
                            addGroupTag = true;
                        }
                    }
                }
                if (addGroupTag)
                {
                    ApplyGroupTag(tagHolder, group);
                }
            }
        }
Пример #2
0
        public void CopyTags(TagHolders tagHolder)
        {
            List <string> words = tagHolder._parts.ToList();

            words = words.Skip(1).ToList();
            words.Insert(0, _parts[0]);
            _parts  = words.ToArray();
            Modifiy = true;
        }
        public void ApplyGroupTag(TagHolders tagHolder, GroupTags group)
        {
            foreach (var tag in group.ClearableTags)
            {
                tagHolder.RemoveTag(tag);
            }

            tagHolder.AddTag(group.MasterTag);
        }