void IInitializable.Initialize() { // parse resource metadata annotation. HashSet<string> metafileExts = new HashSet<string>(); char[] sep = { ';' }; foreach (ChildInfo chInfo in m_schemaLoader.GetRootElements()) { DomNodeType domtype = chInfo.Type; IEnumerable<XmlNode> annotations = domtype.GetTag<IEnumerable<XmlNode>>(); if (annotations == null) continue; foreach (XmlElement annot in annotations) { if (annot.LocalName != "ResourceMetadata") continue; string metaExt = annot.GetAttribute("metadataFileExt").ToLower(); metafileExts.Add(metaExt); string[] resExts = annot.GetAttribute("resourceFileExts").ToLower().Split(sep, StringSplitOptions.RemoveEmptyEntries); foreach (string ext in resExts) { ResourceMetadataInfo metadataInfo = new ResourceMetadataInfo(chInfo, metaExt); m_extMap.Add(ext, metadataInfo); } } } m_metadataFileExts = new string[metafileExts.Count]; metafileExts.CopyTo(m_metadataFileExts); }
void IInitializable.Initialize() { // parse resource metadata annotation. HashSet <string> metafileExts = new HashSet <string>(); char[] sep = { ';' }; foreach (ChildInfo chInfo in m_schemaLoader.GetRootElements()) { DomNodeType domtype = chInfo.Type; IEnumerable <XmlNode> annotations = domtype.GetTag <IEnumerable <XmlNode> >(); if (annotations == null) { continue; } foreach (XmlElement annot in annotations) { if (annot.LocalName != "ResourceMetadata") { continue; } string metaExt = annot.GetAttribute("metadataFileExt").ToLower(); metafileExts.Add(metaExt); string[] resExts = annot.GetAttribute("resourceFileExts").ToLower().Split(sep, StringSplitOptions.RemoveEmptyEntries); foreach (string ext in resExts) { ResourceMetadataInfo metadataInfo = new ResourceMetadataInfo(chInfo, metaExt); m_extMap.Add(ext, metadataInfo); } } } m_metadataFileExts = new string[metafileExts.Count]; metafileExts.CopyTo(m_metadataFileExts); }