Esempio n. 1
0
        public void AddFromManifest(string filePath)
        {
            var manifest = new TagManifest(filePath);

            manifest.Load();

            foreach (var tag in manifest.Tags)
            {
                _tagByName.Add(tag.Name, tag);

                if (!string.IsNullOrEmpty(tag.Category))
                {
                    if (!_tagNamesByCategory.ContainsKey(tag.Category))
                    {
                        _tagNamesByCategory.Add(tag.Category, new HashSet <string>());
                    }

                    _tagNamesByCategory[tag.Category].Add(tag.Name);
                }
                else
                {
                    _uncategorizedTagNames.Add(tag.Name);
                }
            }
        }
Esempio n. 2
0
        public void SaveToManifest(string filePath)
        {
            var manifest = new TagManifest(filePath);

            foreach (var tag in Tags)
            {
                if (tag is Tag castTag)
                {
                    manifest.Tags.Add(castTag);
                }
            }

            manifest.Save();
        }