Example #1
0
        private void ResolveContainer(XmlReader reader, MetadataFile file)
        {
            if (reader.ReadState == ReadState.Initial)
            {
                reader.Read();
            }

            if (reader.NodeType != XmlNodeType.Element)
            {
                throw new InvalidOperationException("The reader position is invalid.");
            }

            switch (reader.NamespaceURI.ToLowerInvariant())
            {
            case XML_STORAGE_NAMESPACE_URI:
                var storageContainer = new MetadataStorageContainer(reader.GetAttribute(XML_NAME_ATTRIBUTE), reader.GetAttribute("provider"), file);
                file.Storages.Add(storageContainer);

                using (reader = reader.ReadSubtree())
                {
                    this.ResolveContainer(reader, storageContainer);
                }

                break;

            case XML_CONCEPT_NAMESPACE_URI:
                var conceptContainer = new MetadataConceptContainer(reader.GetAttribute(XML_NAME_ATTRIBUTE), file);
                file.Concepts.Add(conceptContainer);

                using (reader = reader.ReadSubtree())
                {
                    this.ResolveContainer(reader, conceptContainer);
                }

                break;

            default:
                using (reader = reader.ReadSubtree())
                {
                    this.ProcessUnrecognizedElement(reader, file, null);
                }

                break;
            }
        }
Example #2
0
 public MetadataStorageEntityCollection(MetadataStorageContainer container) : base(container)
 {
 }