public void UpdateLookupStructures(TaxonomyFile taxonomyFile)
        {
            var schema = taxonomyFile as Schema;
            if (schema != null)
            {
                foreach (var item in schema.Items)
                {
                    _itemsById[item.Id] = item;
                    _itemsByName[item.Name] = item;
                }

                foreach (var roleType in schema.RoleTypes)
                {
                    _roleTypesByRole[roleType.Role] = roleType;
                }
            }

            var linkbase = taxonomyFile as Linkbase;
            if (linkbase != null)
            {
                foreach (var link in linkbase.Links)
                {
                    _linksByRole[link.Role] = link;
                }
            }
        }
Пример #2
0
 public void Add(TaxonomyFile taxonomyFile)
 {
     if (EntryPoint != null)
     {
         throw new InvalidOperationException("Tried to add a second entry point to a taxonomy.");
     }
     SetEntryPoint(taxonomyFile);
 }
Пример #3
0
 public void Add(TaxonomyFile taxonomyFile)
 {
     taxonomyFile.Taxonomy = Taxonomy;
     Dependencies.Add(taxonomyFile);
     Taxonomy.Dts.UpdateLookupStructures(taxonomyFile);
 }
Пример #4
0
 public void SetEntryPoint(TaxonomyFile entryPoint)
 {
     EntryPoint          = entryPoint;
     entryPoint.Taxonomy = this;
     Dts.UpdateLookupStructures(entryPoint);
 }