Exemplo n.º 1
0
        public void ReadXml(XmlReader reader)
        {
            string uri = reader.GetAttribute(Attr.panorama_publish_uri);
            if (!string.IsNullOrEmpty(uri))
                PanoramaPublishUri = new Uri(uri);
            string docGuid = reader.GetAttribute(Attr.document_guid);
            if (!string.IsNullOrEmpty(docGuid))
                DocumentGuid = docGuid;

            var allElements = new List<IXmlSerializable>();
            // Consume tag
            if (reader.IsEmptyElement)
                reader.Read();
            else
            {
                reader.ReadStartElement();
                reader.ReadElements(allElements, GetElementHelpers());
                reader.ReadEndElement();
            }
            _annotationDefs = MakeReadOnly(allElements.OfType<AnnotationDef>());
            _groupComparisonDefs = MakeReadOnly(allElements.OfType<GroupComparisonDef>());
            ViewSpecList = allElements.OfType<ViewSpecList>().FirstOrDefault() ?? ViewSpecList.EMPTY;
        }
Exemplo n.º 2
0
 public void ReadXml(XmlReader reader)
 {
     if (RetentionTimeSources != null || FileAlignments != null)
     {
         throw new InvalidOperationException();
     }
     var sources = new List<RetentionTimeSource>();
     var fileAlignments = new List<FileRetentionTimeAlignments>();
     if (reader.IsEmptyElement)
     {
         reader.Read();
     }
     else
     {
         reader.Read();
         reader.ReadElements(sources);
         reader.ReadElements(fileAlignments);
         reader.ReadEndElement();
     }
     RetentionTimeSources = ResultNameMap.FromNamedElements(sources);
     FileAlignments = ResultNameMap.FromNamedElements(fileAlignments);
 }