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);
 }